Closed dhanrajbhandari closed 2 years ago
Look like in my case. I have filtered TextNode and get original text
node.children()
.filter {
$0.hasText()
}
.compactMap {
print("🚀🚀🚀")
print($0.ownText())
}
@thanhdiqit good except delete hasText()
as this reintroduces the behavior OP doesn't want (check the source code - it will exclude whitespace text nodes)
Is there any option to disable trimming whitespaces?
Currently, element.text() method gives trimmed and whitespace normalised text. Any other way to get element text without trimmed and whitespace normalised?