orgajs
orgajs copied to clipboard
Lex newlines in paragraphs as newlines
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).