-
-
Notifications
You must be signed in to change notification settings - Fork 23
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 in Markdown #19
Comments
hey, sorry for the wait, was busy with other stuff! This is a duplicate of #14, the answer is still the same! |
Hi @wooorm thanks for the reply. I wasn't expecting this to be a hard fix, since it works for tags like As a workaround I prefixed the text with a character and stripe it after words, it's not very elegant, but it seems to work for all cases. Maybe a similar workaround can be introduced in this library in order to prevent unexpected behaviours. |
The proper way to deal with HTML is through remark-rehype, rehype-raw, and then getting the text. |
Hi @wooorm, it's fine if the workaround is not added, but I think this should be documented. The readme says this library removes HTML, but now you say the proper way is to use extra plugins for it. I was replacing a different implementation with this library and I was lucky that a test was covering this case, otherwise I might not have detected it until production. Anyway, thanks for maintaining this project, it was really useful for me. |
I think what’s confusing here is: <p>foo</p> *bar* ^-- this whole thing is HTML to markdown. The emphasis doesn’t work. The docs refer to that aspect of HTML in markdown. But from what I gather, you’re reading |
Added a link to this issue next to where the readme mentions HTML! |
Subject of the issue
Strings starting with
<p>...</p>
cause everything else to be dropped.Actual: ""
Expected: "foo bar"
With some text before the tag, it works as expected:
Actual: "foo bar"
Your environment
Steps to reproduce
The issue can also be reproduced on the demo, just enter:
Expected behavior
<p>
tag should be stripped and the inner text should be returned. This behavior works with other tags like<span>
.Actual behavior
<p>foo</p> bar
returns an empty string, butfoo <p>bar</p>
returns "foo bar".The text was updated successfully, but these errors were encountered: