Post

Replies

Boosts

Views

Activity

LibXML2 parsing whitespace and line breaks
When using libXML2 to parse HTML, by default, libXML2 normalizes and merges whitespace characters (including line breaks) on text nodes, which can cause line breaks within tags such as,, script, style, etc. to be removed or merged. But for tags like, line breaks and whitespace are meaningful and need to be preserved. How should it be set up?
1
0
60
Jun ’25
LibXML2 parsing whitespace and line breaks
When using libXML2 to parse HTML, by default, libXML2 normalizes and merges whitespace characters (including line breaks) on text nodes, which can cause line breaks within tags such as,, script, style, etc. to be removed or merged. But for tags like, line breaks and whitespace are meaningful and need to be preserved.
2
0
62
Jun ’25