Repository navigation
🐛 FIX: Avoid gfm_autolink hangs in link labels - #161
Merged
chrisjsewell merged 3 commits intoNov 9, 2026
Merged
Conversation
Decline silent autolink matches so link-label scanning can handle structural delimiters without looping or consuming the closing bracket.
AryanRG
marked this pull request as ready for review
October 14, 2026 13:41
chrisjsewell
added a commit
that referenced
this pull request
Nov 10, 2026
Brings in #148, #138, #153, #157, #149, #152, #154, #158, #159, #161, #162. Conflicts: - attrs/index.py: #153 merges inline classes from the opening token (attr_token), #150 passes state.md to _add_attrs; both kept. - tests/test_attrs.py, tests/test_texmath.py: both sides' tests kept. Adds test_class_accumulation_is_filtered: classes merged across inline groups (onto the opening token) and across stacked block attributes still pass through the on*, URL and allowed filters.
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #160.
With
gfm_autolink_plugin,see [www.example.com](https://example.com)hangs while scanning the link label. The autolink rules report a successful silent match without advancing the parser.The WWW, protocol, and email rules now decline silent matches, allowing the parser to inspect link delimiters normally. All three rules are needed: text before
[can supply a protocol or email prefix that also triggers the hang. Normal token-emitting autolink behavior is unchanged.Seven regression fixtures assert complete HTML for the two reported examples, image alt text, reference links, and inherited protocol/email/mailto prefixes.
Validation:
tox -e py312and an independenttox -e py313: 518 tests passed in each environment.tox -e mypyandtox -e pre-commit -- --all-filespassed.AI assistance was used to prepare the implementation and regression tests. New fixture inputs are synthetic.