Markdown reader: auto-close unclosed divs.

This applies to both fenced and HTML-ish varieties.
Otherwise we face an exponential performance problem with
backtracking.

This also accords with the behavior of the `fenced_divs`
extension in commonmark.

A warning is issued when a div is implicitly closed.

Closes #9635.
This commit is contained in:
John MacFarlane
2024-04-10 17:18:05 -07:00
parent 820e371d94
commit a0c1bdeb8b
3 changed files with 30 additions and 14 deletions
+16
View File
@@ -0,0 +1,16 @@
```
% pandoc
> ::: {.fence}
> that is
> not closed
okay
^D
2> [WARNING] Div at _chunk line 1 column 1 unclosed at _chunk line 5 column 1, closing implicitly.
<blockquote>
<div class="fence">
<p>that is not closed</p>
</div>
</blockquote>
<p>okay</p>
```