Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MinusGix opened this issue Feb 2, 2022 · 0 comments
Open

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

MinusGix opened this issue Feb 2, 2022 · 0 comments
Labels
bug Something isn't working enhancement New feature or request sugarcube-2 Relating to the SugarCube-2 Story Format

Comments

@MinusGix
Copy link
Collaborator

MinusGix commented Feb 2, 2022

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:

  • Copy the file's content and replace all the newlines. This has unfortunate performance issues for anything large.
  • Make various parts which parse content (macro collection, argument parsing, parameter validation) have a separate mode where they ignore newlines.

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.

@MinusGix MinusGix added bug Something isn't working enhancement New feature or request sugarcube-2 Relating to the SugarCube-2 Story Format labels Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request sugarcube-2 Relating to the SugarCube-2 Story Format
Projects
None yet
Development

No branches or pull requests

1 participant