inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
4.07k stars 489 forks source link

Unexpected line break generated by the space between bracket and the arrow #860

Closed cyanlink closed 1 year ago

cyanlink commented 1 year ago

See: https://github.com/inkle/ink-unity-integration/issues/193 It turned out that the culprit is the space between the bracket and the arrow. Such space will be considered as contents! Such spacing is very common amongst other programming languages for formatting purposes. e.g. :

[Option One] -> helloworldknot ->

The space after right bracket will be considered a content line, generating a "\n" line in the output JSON. Possible solution: ignore empty tokens or tokens containing only invisible characters, do not treat them as content blocks.

joningold commented 1 year ago

The ink engine produces empty lines frequently as part of its processing steps; your code should skip them as part of your basic Continue() loop.