cyrusfirheir / twee3-language-tools

[ VSCode extension ] Syntax highlighting and programmatic language tools for Twee 3, and Twine 2 storyformats.
https://marketplace.visualstudio.com/items?itemName=cyrusfirheir.twee3-language-tools
MIT License
47 stars 16 forks source link

Process nobr passages as if they don't have line breaks #90

Open MinusGix opened 2 years ago

MinusGix commented 2 years ago

Currently we seem to ignore the nobr tag on passages, and so we can produce incorrect errors on code which uses these.
It would be better if we process them closer to how sugarcube-2 process them.
There's two methods that we could use:

The second option is the preferred option, though it does complicate things and s potentially non-trivial to implement (but certainly feasible) and could have some mild performance negative on non-nobr use-cases.
The issue at the moment is that we aren't doing per-passage parsing, and this is per-passage.
We would also probably want to handle parsing the content of a nobr tag, since that has the same implications.
We would also want to provide a global option, since one can set nobr globally on a project.