Commit Graph

2537 Commits

Author SHA1 Message Date
dependabot[bot]
9393560d70 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 08:17:02 -06:00
John MacFarlane
7195c6735f commonmark writer: less aggressive escaping for !.
See #131.
2023-02-08 09:48:51 -08:00
Nick Wellnhofer
dfb1526b38 spec_tests.py: Add option to generate fuzz corpus
Add an option `--fuzz-corpus` that writes the test cases to separate
files including the options header, so they can be used as seed corpus
for fuzz testing.
2023-02-02 08:03:29 -08:00
dependabot[bot]
587e0774ff Bump actions/upload-artifact from 1 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-29 15:41:57 -08:00
dependabot[bot]
7f6009170c Bump actions/checkout from 1 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 1 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-29 15:41:33 -08:00
Nick Schonning
1d4aa8d3aa typo: spacse -> spaces 2023-01-29 15:24:41 -08:00
Nick Schonning
665c7ce23d chore: remove unreferenced badge icons 2023-01-29 15:09:36 -08:00
Nick Schonning
9b9901a7a5 chore: Remove Travis-CI config 2023-01-29 15:08:39 -08:00
Nick Schonning
2c087bc9aa chore: Add dependabot for GitHub Actions 2023-01-29 15:05:25 -08:00
John MacFarlane
5ba25ff40e Update changelog. 2023-01-23 10:45:24 -08:00
John MacFarlane
387e759a8e Bump to 0.30.3. 2023-01-23 10:40:54 -08:00
John MacFarlane
7606801084 Fix quadratic complexity bug.
Previously in parsing the repeated pattern `![[]()` the parser
repeatedly scanned to the beginning of the increasingly large
stack of bracketed delimiters, trying to set the link delimiters
to "inactive" to prevent links inside links.

This commit removes the `active` flag from the bracketed delimiters, and
adds a new boolean flag `no_link_openers` on subject. This can be
set to true after a link is matched, telling the parser not to
bother forming a link if it matches an open bracket. It is set
to false when a new link open bracket is added to the stack of
openers. This new approach avoids the need to traverse the stack
of open brackets.

Resolves CVE-2023-22486.
Ref: https://github.com/github/cmark-gfm/security/advisories/GHSA-r572-jvj2-3m8p#event-87337
2023-01-23 10:25:21 -08:00
John MacFarlane
0e5ae6eb0e Add new pathological test for pattern "![[]()"*n.
This was formerly quadratic.
2023-01-23 10:24:40 -08:00
John MacFarlane
c5d5721bfd CI lint: use clang-tidy-11 because we've changed ubuntu versions. 2023-01-13 09:30:03 -08:00
John MacFarlane
511efeb93f Add pathological test for repeated '<!--'. 2023-01-13 09:22:53 -08:00
John MacFarlane
6a5126a8d6 Fix quadratic parsing issue with repeated <!--.
We handle this the same way we handle the parallel issue with
declarations: if we reach the end of input without seeing `-->`,
we set a flag telling us not to try again.
2023-01-13 09:22:48 -08:00
John MacFarlane
b1d961c8f7 Allow declarations with no space, as per spec. Closes #456. 2022-11-03 08:57:23 -07:00
Jeroen Ooms
cd5b2f69eb
Fix -Wstrict-prototypes warnings (#452) 2022-10-13 08:38:41 -07:00
John MacFarlane
8b23bf9356 Set enumi* counter correctly in LaTeX output.
Closes #451.
2022-09-22 09:09:19 -07:00
John MacFarlane
8be7f66ab4 Allow <!DOCTYPE to be case-insensitive.
(This conforms to the existing spec.)
2022-09-21 11:01:12 -07:00
John MacFarlane
4470ff3381 Fixed HTML comment scanning.
Need to handle this case: `<!--> and -->`.

Since the scanner finds the longest match, we had to
move some of the logic outside of the scanner.
2022-09-08 10:50:03 -07:00
John MacFarlane
3dfe48d6bf Update HTML comment scanner...
to accord with commonmark/commonmark-spec#713.
2022-09-08 10:05:46 -07:00
John MacFarlane
9c1922e117 Simplify shell.nix. 2022-09-08 10:04:32 -07:00
John MacFarlane
32634a915a Add shell.nix. 2022-09-08 08:56:57 -07:00
John MacFarlane
1db08eacc1 Revert "Update spec.txt"
This reverts commit c0459ddf20.
2022-08-23 08:55:33 -07:00
John MacFarlane
d99afb5a46 Revert "Omit alt tag if image description is empty."
This reverts commit 0169d3849a.
2022-08-23 08:55:28 -07:00
John MacFarlane
eb54ef4d68 pathological tests: half the number of repetitions, and the timeout.
This reduces the time needed for the pathological tests.
2022-08-13 14:01:52 -07:00
John MacFarlane
0169d3849a Omit alt tag if image description is empty.
This is better than `alt=""`, which signals to browsers that
the image is not part of the main content.
See commonmark/commonmark-spec#718.
2022-08-13 13:53:02 -07:00
John MacFarlane
c0459ddf20 Update spec.txt 2022-08-13 13:52:54 -07:00
Nick Wellnhofer
ead4c0b5c2
Shrink struct cmark_node (#446)
The internal_offset member is only used for headings and can be moved
to struct cmark_heading. This reduces the size of struct cmark_node
from 112 to 104 bytes on 64-bit systems.
2022-07-21 00:40:43 +02:00
Nick Wellnhofer
9c8e834136 Add -Wstrict-prototypes and fix offending functions 2022-01-24 09:19:18 -08:00
Dimitris Apostolou
72549a214a Fix typos 2022-01-03 23:57:22 -08:00
Nick Wellnhofer
2dca096d8e Fix quadratic behavior involving get_containing_block
Fix quadratic behavior in the Commonmark renderer when determining the
tight list status in deeply nested inlines.

Instead of searching for the containing block, update the tight list
status when

- entering a child of a list item
- exiting a list

Fixes #431.
2021-12-03 10:05:19 -08:00
Nick Wellnhofer
99b48963a2 Fix pathological_tests.py
- Use a multiprocessing.Queue to actually get results from spawned
  tests processes.
- Fix the allowed_failures test.
- Truncate actual output when printed.
- Prepare for testing pathological behavior of the Commonmark renderer.
2021-12-03 09:28:50 -08:00
Dan Cîrnaț
bf2be59543 Fix *cmark_get_default_mem_allocator(void) prototype
Fixes `error: function declaration isn't a prototype [-Werror=strict-prototypes] `
2021-11-29 09:11:38 -08:00
kyle
affa616c13 Add test for inline backtick parse 2021-11-10 08:54:41 -08:00
kyle
7e63cfd108 [Bugfix] Fix the backticks bug 2021-11-10 08:54:41 -08:00
John MacFarlane
a8da5a2f25 Update date on man page. 2021-09-24 08:56:14 -07:00
John MacFarlane
596fa88ed3 Makefile: fix name for release target. 2021-09-24 08:56:03 -07:00
John MacFarlane
2f03f1db5c Bump to 0.30.2, update changelog. 2021-09-24 08:49:40 -07:00
Nick Wellnhofer
4efec3552c Fix parsing of emphasis before links
Fix a regression introduced with commit ed0a4bf. Also test the first
delimiter against stack_bottom in process_emphasis. This happened to
work with the old code and only resulted in an unnecessary scan.

Fixes #424.
2021-09-24 08:39:25 -07:00
data-man
c9645909cc Update to Unicode 14.0 2021-09-17 09:03:47 -07:00
frogtile
6fcf869337 Add ~ to safe href character set
resolves #394
2021-08-28 20:58:21 -07:00
Saleem Abdulrasool
077736eeef Update CMakeLists.txt
Bump the minimum required CMake to 3.7.  CMake 3.1 is required for the `CMAKE_C_STANDARD` and `CMAKE_C_STANDARD_REQUIRED` options to take effect.  Relying on CMake to control the compiler this way allows us to avoid having to rebuild the logic for detecting the appropriate flags and ensuring that the compiler is able to support the necessary language version.
2021-08-21 17:30:58 -07:00
Saleem Abdulrasool
599da32b7e build: impertively define output name for static library
When building with an older CMake, the generator expression is not
evaluated properly and embedded into the final output name which is
incorrect.  This should repair the ability to build with an older CMake.
2021-08-17 09:29:12 -07:00
Sebastián Mancilla
15762d7d39 Fix install paths in libcmark.pc
CMAKE_INSTALL_<dir> can be relative or absolute path, so it is wrong to
prefix CMAKE_INSTALL_PREFIX because if CMAKE_INSTALL_<dir> is set to an
absolute path it will result in a malformed path with two absolute paths
joined together:

    $ cmake -DCMAKE_INSTALL_PREFIX=/foo/bar \
        -D CMAKE_INSTALL_BINDIR=/foo/bar/bin \
        -D CMAKE_INSTALL_LIBDIR=/foo/bar/lib \
        -D CMAKE_INSTALL_INCLUDEDIR=/foo/bar/include \
        ..

    $ cat src/libcmark.pc
    prefix=/foo/bar
    exec_prefix=/foo/bar
    libdir=/foo/bar//foo/bar/lib
    includedir=/foo/bar//foo/bar/include
    ...

The libdir and includedir should be set by either calculating the
directories relative to the prefix or by using the
CMAKE_INSTALL_FULL_<dir> variables from GNUInstallDirs.

The CMAKE_INSTALL_FULL_<dir> variables seem the simpler solution.
2021-08-14 10:20:18 -07:00
John MacFarlane
0d408e6cbf Expand tabs to spaces in source code.
Sources were not consistently using spaces.
2021-07-17 15:35:23 -07:00
John MacFarlane
977b128291 Update changelog. 2021-07-16 18:45:36 -07:00
John MacFarlane
4e5068c1d9 Bump to 0.30.1, update cmark(3) man page. 2021-07-16 18:29:03 -07:00
John MacFarlane
365e1c09bd make_man_page.py - include cmark version instead of LOCAL. 2021-07-16 18:25:58 -07:00