gfngfn / SATySFi

A statically-typed, functional typesetting system
GNU Lesser General Public License v3.0
1.16k stars 83 forks source link

Inconsistent treatment of trailing line breaks/spaces in a literal string #243

Closed na4zagin3 closed 3 years ago

na4zagin3 commented 3 years ago

In the current implementation (SATySFi 0.0.5), trailing line breaks in a literal trimmed inconsistently.

`string`# style literal removes up to one trailing line break (U+000A), `string`# style literal up to two line breaks. Anyway, spaces (U+0020) followed by the trailing line breaks won't be trimmed.

Hereinafter ⏎ represents a line break character (U+000A) and ␣ a space (U+0020).

Literal Interpreted
`a␣⏎`# | a␣
`a␣⏎⏎`# | a␣⏎
`a␣⏎⏎⏎`# | a␣⏎⏎
`a␣⏎` | a␣
`a␣⏎⏎` | a␣
`a␣⏎⏎⏎` | a␣⏎
`a␣⏎⏎⏎⏎` | a␣⏎⏎

I would expect one of the following behaviors:

Original comment: https://satysfi.slack.com/archives/CTGUT75FZ/p1584115832024200

na4zagin3 commented 3 years ago

Oops, this duplicates #233. I'm so sorry.