scinfu / SwiftSoup

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
https://scinfu.github.io/SwiftSoup/
MIT License
4.52k stars 345 forks source link

Is there an option to keep all whitespace characters? #204

Closed SF-Simon closed 1 year ago

SF-Simon commented 2 years ago

We have some paragraphs where the user entered blank characters and carriage return characters etc. But the html will all be lost after being SwiftSoup.parsed. Only 1 whitespace character remains in each position.

SF-Simon commented 2 years ago

By looking at the source code, I found that clipping can be cancelled as long as prettyPrint is set to false.

However, this parameter will also invalidate the beautification of HTML nodes.

It is hoped that a separate parameter can be set to act on white space characters.

Thank you.