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

Inconsistent escape of image alt #264

Open
xiaq opened this issue Oct 5, 2022 · 0 comments
Open

Inconsistent escape of image alt #264

xiaq opened this issue Oct 5, 2022 · 0 comments

Comments

@xiaq
Copy link

xiaq commented Oct 5, 2022

An obscure edge case, but still...

< is usually escaped in image alt:

![a <](b.png)

becomes

<p><img src="b.png" alt="a &lt;" /></p>

(https://spec.commonmark.org/dingus/?text=!%5Ba%20%3C%5D(b.png))

However, if the < is part of an HTML tag, it is not escaped in the output:

![a <a>](b.png)

becomes

<p><img src="b.png" alt="a <a>" /></p>

(https://spec.commonmark.org/dingus/?text=!%5Ba%20%3Ca%3E%5D(b.png))

cmark generates the expected output:

<p><img src="b.png" alt="a &lt;a&gt;" /></p>
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

No branches or pull requests

1 participant