In a portion of my code to get a "report view" where the element is different (textarea becomes a div or span) and use the same data with newlines I replace the new lines with page breaks.
Currently the function I use:
I often find myself using this same format for replacing other things, i.e.,
Is there a better way (either about using line breaks or about the
.text(.text())? I've seen suggestions to simply write your own function but I feel like that doesn't solve the generalized problem.