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

invalid HTML involving underscore/asterisk and link notation #277

Open
step- opened this issue Dec 1, 2024 · 0 comments
Open

invalid HTML involving underscore/asterisk and link notation #277

step- opened this issue Dec 1, 2024 · 0 comments

Comments

@step-
Copy link
Contributor

step- commented Dec 1, 2024

Similar to #276 I found a case involving underscore, asterisk and link notation whereby
md2html produces invalid HTML, because of an unbalanced <em> tag.
The intention of all the examples below is not to trigger emphasis, but
you can see that <em> sneaks in regardless.

Note that replacing * for _ in all the examples below produces the same invalid output.


With underscores only:

md2html --fstrikethrough << EOF
a_[](#a%20_) good

a__[](#a%20__) good

a_[](#a%20__) good

a_[](#a%20_/) good, punctuation doesn't matter

_[](_) unbalanced EM

_[](<_>) unbalanced EM

[_][_] balanced but unwanted EMs
EOF

Output (md2html 0.5.2):

<p>a_<a href="#a%20_"></a> good</p>
<p>a__<a href="#a%20__"></a> good</p>
<p>a_<a href="#a%20__"></a> good</p>
<p>a_<a href="#a%20_/"></a> good, punctuation doesn't matter</p>
<p><em><a href="_"></a> unbalanced EM</p>
<p><em><a href="_"></a> unbalanced EM</p>
<p>[<em>][</em>] balanced but unwanted EMs</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