scala-xml
scala-xml copied to clipboard
PrettyPrinter strips newlines from text in nodes, even pcdata
Migrated from https://issues.scala-lang.org/browse/SI-4303.
There is substantial discussion there that is not reproduced here.
Original description:
What steps will reproduce the problem
scala> <foo>{"hi\nthere"}</foo>
res6: scala.xml.Elem =
<foo>hi
there</foo>
scala> new PrettyPrinter(9999,2).format(<foo>{"hi\nthere"}</foo>)
res7: String = <foo>hi there</foo>
scala> new PrettyPrinter(9999,2).format(<foo>{PCData("hi\nthere")}</foo>)
res8: String = <foo><![CDATA[hi there]]></foo>