Skip to content

[5.9] merge in changes from cmark-gfm 0.29.0.gfm.11 #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 68 commits into from
Apr 28, 2023

Conversation

QuietMisdreavus
Copy link

This PR applies the changes from #51 onto the release/5.9 branch.

  • Explanation: cmark-gfm has released patches for two security issues, one of which is in the base parser and should affect swift-cmark as well.
  • Scope: Specially crafted Markdown could lead to resource exhaustion and denial of service.
  • Issue: rdar://107716414
  • Risk: Low. The changes are relatively targeted and don't affect normal Markdown content.
  • Testing: Tests pass in both swift-cmark and Swift-Markdown.

bdotdub and others added 30 commits July 8, 2020 01:14
Currently for the autolink extensioon, only `www_match` correctly returns correct positioning when calling `cmark_node_get_start_line`/`cmark_node_get_start_column`/`cmark_node_get_end_line`/`cmark_node_get_end_column`.

This PR adds positioning support for the `url_match` function.
The old --safe option is now the default, to get the previous default
behavior, use the --unsafe flag.

Signed-off-by: Keith Packard <keithp@keithp.com>
add_compiler_export_flags() is deprecated since CMake 3.0, and was
removed a long time ago in cmark via commit
abf3a7a -- but preserved in cmark-gfm's
modifications.
The export header is identical between the main library and the
extensions. It is generated from the same template, the libraries share
the same properties, and the only difference is that they use different
symbol names. Let them share a header.
cmark-gfm-core-extensions: use stdbool.h instead of private header
man: Switch --safe option for --unsafe in man page
[Autolink] Store positioning info for url_match
extensions: avoid useless duplication of headers
Co-authored-by: Waldir Pimenta <waldyrious@gmail.com>
…ent_footnote_def

Expose `cmark_node_parent_footnote_def`.
fix: Links with unique targets should have unique labels
cmark-gfm/src/node.h:122:36: warning: this function declaration is not a prototype [-Wstrict-prototypes]
void cmark_init_standard_node_flags();
                                   ^
                                    void
1 warning generated.
STRONG, in most rendering engines, becomes bold. Bold cannot be applied to
text two times in most languages. This caps the number of times we attempt
to bold text when rendering.

Running `python3 -c 'pad = "_" * 100000; print(pad + "." + pad, end="")' | time ./build/src/cmark-gfm --to $LANG`

Before:

```
./build/src/cmark-gfm --to plaintext > /dev/null  12.29s user 0.00s system 99% cpu 12.321 total
./build/src/cmark-gfm --to commonmark > /dev/null  25.97s user 0.01s system 99% cpu 26.026 total
./build/src/cmark-gfm --to html > /dev/null  0.01s user 0.00s system 43% cpu 0.033 total
./build/src/cmark-gfm --to man > /dev/null  12.91s user 0.00s system 99% cpu 12.938 total
./build/src/cmark-gfm --to latex > /dev/null  13.13s user 0.01s system 99% cpu 13.159 total
```

After:

```
./build/src/cmark-gfm --to plaintext > /dev/null  0.01s user 0.01s system 39% cpu 0.030 total
./build/src/cmark-gfm --to commonmark > /dev/null  0.01s user 0.00s system 41% cpu 0.031 total
./build/src/cmark-gfm --to html > /dev/null  0.01s user 0.00s system 38% cpu 0.030 total
./build/src/cmark-gfm --to man > /dev/null  0.01s user 0.01s system 40% cpu 0.030 total
./build/src/cmark-gfm --to latex > /dev/null  0.01s user 0.00s system 39% cpu 0.033 total
```
kevinbackhouse and others added 18 commits April 3, 2023 14:17
Fix quadratic list indexing in commonmark/man/plaintext output formats
…t-cmark-gfm

Limit the depth of nested lists
Co-authored-by: Bas Alberts <13686387+anticomputer@users.noreply.github.com>
…brackets-overflow

Fix bug in fuzz harness
…ut-formats

Add other output formats to the quadratic fuzzer
Bump version and start Changelog for 0.29.0.gfm.11
@daniel-grumberg
Copy link

Does @franklinsch need to approve this?

@QuietMisdreavus
Copy link
Author

According to the 5.9 announcement thread, swift-cmark and Swift-Markdown technically don't have release managers. Unofficially, i'm the maintainer of these repos, but i tend to wait for Franklin's approval anyway since he's the release manager for the rest of Swift-DocC's repos.

@franklinsch
Copy link

Thanks for pointing that out @QuietMisdreavus. I will work with the core team to establish release managers for these repos.

@QuietMisdreavus QuietMisdreavus merged commit 80ef13f into release/5.9 Apr 28, 2023
@QuietMisdreavus QuietMisdreavus deleted the QuietMisdreavus/5.9/gfm.11 branch April 28, 2023 18:17
QuietMisdreavus added a commit that referenced this pull request May 4, 2023
…/5.9/gfm.11

[5.9] Un-revert #52 and fix Windows build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.