nvim-neorg / norg-specs

A collection of specifications and grammars for Neorg's file format, `norg`.
88 stars 18 forks source link

Hard line break support #21

Open boltlessengineer opened 1 year ago

boltlessengineer commented 1 year ago

Norg spec doesn't seem to have a feature to put hard line break (<br/> in HTML) inside a paragraph.

I think escaped character can be an intuitive way to have it. GFM supports both \n and \\\n, but because Norg is free-form markup language, just \\\n would be a nice option.

example:

soft
line break

hard\
line break

other paragraph

converted to:

<p>soft
paragraph</p>
<p>hard<br/>line break</p>
<p>other paragraph</p>

which would be rendered like:

soft paragraph

hard
line break

other paragraph
vhyrro commented 1 year ago

I realized that the current usage of \\n within norg is very counterintuitive. Currently when you use the escape character:

here is\
some text

The expected result (as per the spec) should be:

here issome text

However the \ char is more of a "make this verbatim". When you use \* you don't expect that character to be a bold marker (in other words, it should be rendered as-is). I'm happy to make \\n be the equivalent of <br>, and find another solution to the first code snippet.