Skip to content
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

merge in changes from cmark-gfm 0.29.0.gfm.11 #51

Merged
merged 69 commits into from
Apr 28, 2023

Conversation

QuietMisdreavus
Copy link

This merges in upstream changes from cmark-gfm, bringing our base version from gfm.8 to gfm.11. Notably, this includes some new public APIs and fixes for two upstream security issues.

I made a change on top of the upstream code to make the "enable safety checks" setting thread-safe. I don't expect this to be used from Swift-DocC's multithreaded code, but i've made it a point to guard as many statics as i could behind locks, so this one joins the rest.

The most notable merge-conflict change between upstream cmark-gfm and swift-cmark was the way that the export header(s) were configured, since we have a pre-generated copy in the repo for use by the Swift package. Pointing the extensions code to use the base export header seemed to work, both for the Swift package as well as the Makefile. There were also a couple conflicting spots in the code where i'd added something in the same spot as upstream. Otherwise, this PR is all code from upstream.

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 <[email protected]>
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 <[email protected]>
…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 <[email protected]>
…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
@QuietMisdreavus
Copy link
Author

I've confirmed that tests still work both via make test and swift run api_test.

@QuietMisdreavus QuietMisdreavus merged commit 5ccf7dc into gfm Apr 28, 2023
@QuietMisdreavus QuietMisdreavus deleted the QuietMisdreavus/gfm.11 branch April 28, 2023 18:17
QuietMisdreavus added a commit that referenced this pull request May 3, 2023
…/gfm.11

Un-revert #51 and fix Windows build errors
@QuietMisdreavus QuietMisdreavus restored the QuietMisdreavus/gfm.11 branch May 4, 2023 16:34
@QuietMisdreavus QuietMisdreavus deleted the QuietMisdreavus/gfm.11 branch May 4, 2023 19:46
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.