LibXML2 parsing whitespace and line breaks

This thread has been locked by a moderator; it no longer accepts new replies.

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<pre>,<textarea>, script, style, etc. to be removed or merged. But for tags like<pre>, line breaks and whitespace are meaningful and need to be preserved. How should it be set up?

Answered by DTS Engineer in 841966022

Let’s focus this discussion on your other thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Boost

Let’s focus this discussion on your other thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

LibXML2 parsing whitespace and line breaks
 
 
Q