Skip to content

PrettyPrinter strips newlines from text in nodes, even pcdata #76

Open
@mbeckerle

Description

@mbeckerle

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions