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

Fix premature (and incomplete) HTML-escaping of links #395

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

mentalisttraceur
Copy link
Contributor

@mentalisttraceur mentalisttraceur commented Nov 1, 2024

This fixes three bugs:

  1. links were being prematurely HTML-escaped (when being parsed into AST instead of waiting until rendering to HTML) ( Certain characters in markdown code incorrectly parsed (e.g., &) #394 )
  2. image directive was double-escaping target links, and
  3. image directive wasn't escaping src links at all.

Same idea as the fix in #393 - move the HTML-escaping out of the parse and into the rendering.

Tests updated to catch all three bugs.

You can merge this and #393 in any order (no merge conflicts either way).

@veenstrajelmer
Copy link

veenstrajelmer commented Nov 1, 2024

Thanks for this PR. I locally checked out the branch to check its effect in my sphinx-build usecase. I just wanted to confirm that your PR indeed fixes the issue I encountered.

@veenstrajelmer
Copy link

veenstrajelmer commented Nov 1, 2024

And additionally, #393 fixes another issue I encountered only recently for the first time. Thanks for these very helpful contributions!

@lepture lepture merged commit 498f0e8 into lepture:master Nov 7, 2024
3 of 15 checks passed
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.

3 participants