jgm/djot

how are block elements recognized?

ffel opened this issue · 2 comments

ffel commented

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!

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

jgm commented

2\. is indeed the way to go.