Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrettyPrinter removes newlines #75

Open
mbeckerle opened this issue Jul 29, 2015 · 5 comments
Open

PrettyPrinter removes newlines #75

mbeckerle opened this issue Jul 29, 2015 · 5 comments

Comments

@mbeckerle
Copy link

Migrated from https://issues.scala-lang.org/browse/SI-4543.

There is discussion there that is not reproduced here.

Original description is:

What steps will reproduce the problem (please be specific and

scala> <foo>{PCData("hello\nworld")}</foo>
res51: scala.xml.Elem =
<foo><![CDATA[hello
world]]></foo>

scala> (new PrettyPrinter(Int.MaxValue, 2)).format(res51)
res52: String = <foo><![CDATA[hello world]]></foo>

What is the expected behavior?

Should print "hello\nworld"

scala> (new PrettyPrinter(Int.MaxValue, 2)).format(res51)
res52: String = <foo><![CDATA[hello\nworld]]></foo>

What do you see instead?
prints "hello world"

What versions of the following are you using?
Scala: 2.8.1

@themerius
Copy link

Any news on that issue?

@ashawley
Copy link
Member

I've never looked in to the issue, myself. Did you run in to this problem or similar?

@themerius
Copy link

Yesterday I stumbled across this issue. Now I'm using .toString which produces now correct XML, but the XML is now quite ugly.

@techncl
Copy link

techncl commented Mar 7, 2024

Any news on this issue? It's still happening in Scala 2.13.12 and it also converts multiple spaces into 1 space.

@wim82
Copy link

wim82 commented Nov 20, 2024

I was hoping for this to work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants