mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-23 08:46:56 +00:00
Markdown reader: Fix parsing bug with nested fenced divs.
Closes #4281. Previously we allowed "nonindent spaces" before the opening and closing `:::`, but this interfered with list parsing, so now we require the fences to be flush with the margin of the containing block.
This commit is contained in:
@@ -1971,7 +1971,6 @@ divHtml = try $ do
|
||||
divFenced :: PandocMonad m => MarkdownParser m (F Blocks)
|
||||
divFenced = try $ do
|
||||
guardEnabled Ext_fenced_divs
|
||||
nonindentSpaces
|
||||
string ":::"
|
||||
skipMany (char ':')
|
||||
skipMany spaceChar
|
||||
@@ -1986,7 +1985,6 @@ divFenced = try $ do
|
||||
|
||||
divFenceEnd :: PandocMonad m => MarkdownParser m ()
|
||||
divFenceEnd = try $ do
|
||||
nonindentSpaces
|
||||
string ":::"
|
||||
skipMany (char ':')
|
||||
blanklines
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
```
|
||||
% pandoc -t native
|
||||
:::: {.a}
|
||||
- ::: {.b}
|
||||
text
|
||||
:::
|
||||
::: {.c}
|
||||
text
|
||||
:::
|
||||
::::
|
||||
^D
|
||||
[Div ("",["a"],[])
|
||||
[BulletList
|
||||
[[Div ("",["b"],[])
|
||||
[Para [Str "text"]]
|
||||
,Div ("",["c"],[])
|
||||
[Para [Str "text"]]]]]]
|
||||
```
|
||||
Reference in New Issue
Block a user