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

Lex newlines in paragraphs as newlines #103

Open
GuiltyDolphin opened this issue Jun 28, 2021 · 0 comments
Open

Lex newlines in paragraphs as newlines #103

GuiltyDolphin opened this issue Jun 28, 2021 · 0 comments

Comments

@GuiltyDolphin
Copy link
Contributor

GuiltyDolphin commented Jun 28, 2021

Check the AST at https://orga.js.org?text=foo%0Abar.

Here we see that the newline between foo and bar is actually treated as a space (this is from the lexer). I think this isn't super intuitive and would be better replaced with a newline token - then whoever is doing the rendering can decide how they want to render these (in the usual case, to replace the newlines with spaces).

Alternatively, we could parse these all as part of the same paragraph, as a newline character, then consumers know that newlines in paragraphs don't end the paragraph (only two together would, and this wouldn't appear in our AST).

@GuiltyDolphin GuiltyDolphin changed the title Lex Org newlines as newlines Lex newlines in paragraphs as newlines Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant