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

Return brackets in autolinks behavior back to cmark-gfm #386

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

digitalmoksha
Copy link
Collaborator

Return brackets in autolinks behavior back to what is found in cmark-gfm

When relaxed-autolinks is specified, also allow balanced brackets/curly braces in autolink, in addition to the standard parentheses. This also helps with detection of autolinks in [[...]]

Related to #382

Comment on lines +193 to +196
// Allow any number of matching parentheses (as recognised in copen/cclose)
// at the end of the URL. If there is a greater number of closing
// parentheses than opening ones, we remove one character from the end of
// the link.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope it was ok to add this from the original C code.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the author of the original text, I deem it so 🙏

Copy link
Contributor

Command Mean [ms] Min [ms] Max [ms] Relative
./bench.sh ./comrak-b0f39ef 318.3 ± 1.6 315.4 322.3 2.87 ± 0.03
./bench.sh ./comrak-main 317.7 ± 0.8 316.1 319.7 2.87 ± 0.03
./bench.sh ./pulldown-cmark 110.7 ± 1.1 109.6 115.7 1.00
./bench.sh ./cmark-gfm 117.2 ± 0.7 115.8 119.0 1.06 ± 0.01
./bench.sh ./markdown-it 475.7 ± 2.9 473.4 488.6 4.30 ± 0.05

Run on Sun Apr 28 18:12:31 UTC 2024

@digitalmoksha
Copy link
Collaborator Author

@kivikakk wdyt?

Copy link
Owner

@kivikakk kivikakk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you — perfect!

Comment on lines +193 to +196
// Allow any number of matching parentheses (as recognised in copen/cclose)
// at the end of the URL. If there is a greater number of closing
// parentheses than opening ones, we remove one character from the end of
// the link.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the author of the original text, I deem it so 🙏

When `relaxed-autolinks` is specified, allow only balanced
brackets/curly braces in autolink.
@kivikakk kivikakk enabled auto-merge April 29, 2024 07:34
@kivikakk kivikakk merged commit 1a84232 into main Apr 29, 2024
24 checks passed
@kivikakk kivikakk deleted the bw-fix-autolink-brackets branch April 29, 2024 07:36
@digitalmoksha
Copy link
Collaborator Author

@kivikakk would it be possible to get a new release cut?

@kivikakk
Copy link
Owner

It's on the way! :)

@kivikakk
Copy link
Owner

Done.

@digitalmoksha
Copy link
Collaborator Author

👍 🙇 🙏

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.

2 participants