taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.11k stars 107 forks source link

structuredText with blank lines #199

Open woellij opened 2 years ago

woellij commented 2 years ago

Hi,

thanks for supporting this library.

I've stumbled upon an issue with structured text, where blank lines from html are ommitted in the structuredText. Is there a way around that?

For example a element with that structure:

 b
    #text
    br
    br
    #text
    br
    br

results in only line-breaked text, but no blank lines.

Thanks for your response in advance.

taoqf commented 2 years ago

Would this help you?

html.replace(/\n/g, '');