jgm / djot

A light markup language
https://djot.net
MIT License
1.71k stars 43 forks source link

how are block elements recognized? #251

Closed ffel closed 11 months ago

ffel commented 11 months ago

As far as I understand, each (most?) block elements are recognized by their first token. If there is no recognition, we default to a para block element.

Is there a way to explicitly start a para block element? Consider the case I want to start a para with a dash.

This appears to work

- first item

- second item

\- no third item, but the start of a para that starts with a dash

So far, so good. Now, I want to start a para with a number and a dot:

1. first item in a numbered list

\2. this is no part of the numbered list as I escaped the 2 character

this is a link to both (further simplified) examples

Again, \2. is not considered part of the numbered list (as intended), however, the backslash has become part of the para element (which was not the case in the correctly rendered bullet list).

Is this a (minor) bug, or did I miss the information on how to escape block element recognition?

Cheers, keep up the good work!

st-pasha commented 11 months ago

You could write 2\. this is no part of the numbered list

jgm commented 11 months ago

2\. is indeed the way to go.