html-parser
html-parser copied to clipboard
don't trim empty text elements
Hey there :)
I have a pipeline like
markdown -> [comrak] -> html
html -> [html-parser] -> nodes
nodes -> [my-logic] -> html
html
And, it took me a while to figure it out why my code blocks were broken! (Missing tabs, missing newlines, ...) 😅
Finally I realized that empty text blocks are not parsed by html-parsed, but they were not "empty", they were "whitespace only", which are still important inside <pre> so I don't think we should get rid of them this easily!
I tested this PR on my repos and it fixes my problem.