jgm / djot

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

Unclosed attributes disappear instead of turning into regular text #126

Closed hellux closed 1 year ago

hellux commented 1 year ago

E.g.

text{a=x

{a=x
# heading

generates

<p>text</p>
<p></p>
<section id="heading">
<h1>heading</h1>
</section>

instead of

<p>text{a=x</p>
<p>{a=x
# heading</p>

Similar to #65

jgm commented 1 year ago

With this push we get

<p>text{a=x</p>
<p>{a=x</p>
<section id="heading">
<h1>heading</h1>
</section>

Still not quite right. If {a=x before # heading is just regular text, then we shouldn't get a heading at all.

We need to put some code into the block parser that is similar to what I just added to the inline parser. Better, make this backtracking code a method on the attribute parser.

jgm commented 1 year ago

Reverting for now because this commit caused fuzz test failures. Need to rethink.

jgm commented 1 year ago

Closed by c68e807cc3343364b2570c6f69a8eaeeb17d0ece and earlier commits.