Open sschuberth opened 5 years ago
It's quite funny that the default LSSerializer
implementation does handle configured line ending only if pretty print is enabled otherwise it is always ignored
Since the first DOCTYPE line is written in our codebase, the easiest solution is to fix \n
right there.
@cy6erGn0m, please see PR #106.
We've run into this bug now, was there a reason the PR was never accepted?
At least on Windows, Document.serialize() writes out documents with mixed line endings: The first line containing
<!DOCTYPE html>
always has Unix line endings, but lines written by Java's XML transformer have platform-specific line endings (i.e. all following lines in the document). According to this answer a possible solution is to use LSSerializer instead.As several tests use multi-line strings for expected results and Kotlin always uses Unix line endings in multi-line strings, it would probably most convenient to always use Unix line endings on any platform. This would also allow to get rid of several
.replace("\r\n", "\n")
calls in the tests.