scalafiddle / scalafiddle-core

Source code for the scalafiddle.io compilation service
https://scalafiddle.io
Apache License 2.0
101 stars 37 forks source link

println trims white space #21

Closed ghost closed 6 years ago

ghost commented 6 years ago
screen shot 2017-10-17 at 08 57 26
ochrons commented 6 years ago

That's how HTML works, unfortunately. I suppose it should be wrapped in a <pre> block instead of <div> to get proper handling of whitespace.

ghost commented 6 years ago

Adding a white-space: pre CSS attribute could also work.

I spent an unholy amount of time trying to get my https://www.hackerrank.com/challenges/staircase/problem solution to work before I realized this bug was to blame. Definitely worth looking into.

ochrons commented 6 years ago

Ah, that CSS trick would be even better. I have a major update to ScalaFiddle coming soon (updates to Scala 2.12) so I'll incorporate this there :)

ghost commented 6 years ago

Thanks! Looking forward to it.

ochrons commented 6 years ago

Works now!

ghost commented 6 years ago

Yes it does! 🍾 💯