Repository navigation
FIX: Keep escapes and entities in image alt text - #1211
Open
Cherith1222 wants to merge 1 commit into
Open
Cherith1222 wants to merge 1 commit into
Cherith1222 wants to merge 1 commit into
Conversation
Image alt text dropped text_special tokens, so a backslash escape or an HTML entity disappeared from the alt attribute. AI-assisted (Cursor). Not yet reviewed by a human.
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 #1210.
Image alt text dropped
text_specialtokens, so a backslash escape or an HTML entity disappeared from thealtattribute. Those tokens are now kept.Tests, on Windows with Python 3.13.3, via Resource Sentinel (1 CPU, 1.5 GiB, 1 I/O):
myst_parser/mdit_to_docutils/base.pychecked out atmaster,test_image_alt_keeps_escapes_and_entitiesfailed. The expected alt wasa * band the rendered alt wasa b.ruff0.15.20checkpassed onmyst_parser/mdit_to_docutils/base.pyandtests/test_image_alt.py. That is the version in the project dependency group.ruff format --checkalso passed on those files.Not run: the full suite, and anything other than Windows.
This patch was drafted with AI assistance (Cursor).