Format breaks when compiling multiline strings on Windows
On Windows, when compiling formatted strings, eg:
format("This is a string
that is on multiple lines")
The resulting compiled string may end up with invalid line breaks in it, eg:
.string "This is a string
that"
.string "is on multiple lines"
This is using the 3.3 Linux Poryscript running a make script through WSL2. The issue seems to happen regardless of using CRLF or just LF endings as performed via git config core.eol lf and git add --update --renormalize.
However on my Ubuntu 22.10 this does not happens.
text MultilineStringOnLinux{
format("This is a string
that is on multiple lines")
}
Gets transformed
MultilineStringOnLinux::
# 810 "data/maps/DewfordTown_Gym/scripts.pory"
.string "This is a string that is on multiple\n"
.string "lines$"
with poryscript 3.3.0
07a2166e1c08076f60bbe12bde0d569e44da528c
IMO this behavior ought to never be used, but Poryscript will now collapse those newlines into a space character.
In other words:
format("This is a string
that is on multiple lines")
is treated as
format("This is a string that is on multiple lines")
Thanks for the fix. I agree that the behavior is iffy, but it is useful for larger text blurbs and the fact that it behaved differently between Linux and Windows has lead to some issues on our project where test strings end up getting committed because they build on some machines but not others. This will definitely save us some headaches.