Closed failable closed 1 month ago
If you want this particular transformation, you will need to replace the <br/>
Element
node by a \n
Text
node and then use .text().collect::<String>()
.
Alternatively, you can use .descendants()
instead of .text()
and filter for text nodes and <br/>
tags directly.
The following code snippet outputs
"Hello, world!good bye"
.Would it better to output
"Hello, world!\ngood bye"
?