Parse Line Breaks in .text()
winsmith opened this issue · 1 comments
winsmith commented
Is there a way to get line breaks out of parsed text? Suppose I have an element like so:
<p class="mycooltext">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.<br><br>
Vestibulum feugiat ex eu turpis efficitur bibendum.
</p>
If I use the text
function on this element, I get
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum feugiat ex eu turpis efficitur bibendum.
But I'd rather have
Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\n Vestibulum feugiat ex eu turpis efficitur bibendum.
with the <br>
tags converted to newlines. Is that possible somehow?
winsmith commented
Apologies, this got created twice.