Repository navigation
Keep wiki links out of existing links and HTML attributes - #769
Open
alexbertho wants to merge 1 commit into
Open
alexbertho wants to merge 1 commit into
alexbertho wants to merge 1 commit into
Conversation
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
wiki-linksextra currently expands[[Home]]inside Markdown links, image descriptions and inline HTML markup. For example,[go [[Home]]](https://example.com)produces nested anchors, while![go [[Home]]](img.png)puts a complete anchor inside the quotedaltattribute.Run wiki-link expansion after Markdown links are resolved and use the existing HTML tokenizer to limit replacements to text outside anchors and markup. Standalone wiki links retain their configured URL/class handling. Document the literal behavior inside existing links and image descriptions.
The regression covers inline and reference links/images, a linked image, raw uppercase anchors, HTML attributes, escaped syntax, code spans and a standalone wiki link following a normal link. Five of the initial regression cases fail on the original implementation.
Validation on Linux, Python 3.12.14, with all optional dependencies installed: the configured
test.py -- -knownfailuresuite passes (305 tests);test/test_redos.pypasses (12 tests), andgit diff --checkpasses. Other Python versions and operating systems were not tested locally.Found by local source inspection and executed reproductions, not a production incident. AI disclosure: investigated, implemented and tested with OpenAI Codex.