Skip to content

transforming <p>honk<br /></p> into Markdown yields a stray backslash? #50

Answered by wooorm
cpiro asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there 👋

Yeah, it’s valid HTML. I think this would be something for hast-util-to-mdast.
The same could be done with headings: <h1>x<br></h1>

I think it would be better to just remove them, instead of the alternative of injecting some non-breaking invisible character after them.

Anyway, probably a filter-trailing-breaks or so utility in hast-util-to-mdast used for both headings andf paragraphs?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants