Closed craftzdog closed 3 years ago
rehype is for HTML, not for XML. Your link isn’t closed, you have divs in spans, it’s all messed up! If I open your “HTML” in a browser, I get something very similar to what you’re getting with remark/rehype:
Why do you have such weird HTML? Can you fix that?
Thanks for the reply.
Yes, I thought the same.
I use remark-rehype
for supporting importing HTML files into my app as Markdown.
I got this broken HTML from my app's user who exported a note from Evernote.
So, it looks like an Evernote's bug where it generates such weird HTML..
oh gosh, that’s some really weird stuff that Evernote is doing 😅
It’s indeed a bug there, you could report it with them maybe, but I’m not sure they’d fix it. An alternative would be to do some processing with a plugin on “evernote html”? Or maybe support their .enex XML files (I see some projects and github that do that)? 🤷♂️
Anyway, not something for this project!
I'm not sure where the actual problem resides but I report it here.
Subject of the issue
If a given HTML has an anchor tag, it yields the broken markdown.
Your environment
Steps to reproduce
If you have an HTML like so:
Convert it into Markdown:
Expected behavior
You should get:
Actual behavior
It outputs: