✨Allow plugins to register inline terminator characters#391
Merged
chrisjsewell merged 7 commits intomasterfrom May 6, 2026
Merged
✨Allow plugins to register inline terminator characters#391chrisjsewell merged 7 commits intomasterfrom
chrisjsewell merged 7 commits intomasterfrom
Conversation
Agent-Logs-Url: https://github.com/executablebooks/markdown-it-py/sessions/e9a49254-6b3a-4ecc-9b57-84f6df4e6ccd Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
Agent-Logs-Url: https://github.com/executablebooks/markdown-it-py/sessions/e9a49254-6b3a-4ecc-9b57-84f6df4e6ccd Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Allow plugins to register inline terminator characters
Allow plugins to register inline terminator characters
May 4, 2026
chrisjsewell
requested changes
May 5, 2026
Agent-Logs-Url: https://github.com/executablebooks/markdown-it-py/sessions/913c6f4f-7b8b-496d-9626-f0e5b7c8bc0a Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
chrisjsewell
requested changes
May 5, 2026
Agent-Logs-Url: https://github.com/executablebooks/markdown-it-py/sessions/04e84ce1-b921-4475-9f26-c0b296e29e33 Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
chrisjsewell
approved these changes
May 5, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #391 +/- ##
=======================================
Coverage 95.83% 95.84%
=======================================
Files 64 64
Lines 3481 3487 +6
=======================================
+ Hits 3336 3342 +6
Misses 145 145
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
@copilot fix pre-commit |
Agent-Logs-Url: https://github.com/executablebooks/markdown-it-py/sessions/1c71001c-d7bd-4b35-8682-9c0afb71b1a9 Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com>
Contributor
Author
chrisjsewell
approved these changes
May 5, 2026
chrisjsewell
approved these changes
May 6, 2026
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.
The inline
textrule used a hardcoded, unexpandable set of terminator characters, forcing plugins that need to trigger on non-terminator characters (e.g.wfor GFMwww.autolinks) to resort to core-rule post-processing workarounds.Changes
parser_inline.py: Moves the terminator set ontoParserInlineas_terminator_chars(aset[str]seeded from_DEFAULT_TERMINATORS) with a pre-compiledterminator_re: re.Pattern[str]attribute. Exposesadd_terminator_char(ch)to extend the set; the regex is rebuilt eagerly only when a genuinely new character is added, keeping zero per-call overhead in the hot path.rules_inline/text.py: Drops the module-level_TerminatorCharsset and@functools.cache-decorated factory. Thetextrule now readsstate.md.inline.terminator_redirectly.docs/contributing.md: Updates the "Why is my inline rule not executed?" FAQ to document the new API.Usage
Fully backward-compatible — the default terminator set is unchanged.