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

HTML not being escaped at all! #27

Open
davidearl opened this issue Jun 23, 2016 · 1 comment
Open

HTML not being escaped at all! #27

davidearl opened this issue Jun 23, 2016 · 1 comment

Comments

@davidearl
Copy link

Oh dear, this is a pretty fundamental lack of reading of the markdown spec or lack of understanding of html.

If you write this markdown[1]:
wibble & wobble 4 < 5
it should translate as
wibble &amp; wobble 4 &lt; 5
but it doesn't, so generates incorrect HTML.

If you're going to try to sort this using pattern matching, don't forget that the document might end with an ampersand or less-than. Given that, while less-than need not be escaped inside attribute values, it does no harm either, there may be a common pattern matching solution for general text and ampersand inside attributes (but not for double quotes inside attributes, I think).

[1] https://daringfireball.net/projects/markdown/syntax#autoescape

@davidearl
Copy link
Author

The title was perhaps rather extreme, sorry. Changed to be more accurate.

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