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:
John MacFarlane
2018-01-20 14:44:08 -08:00
parent e69ca9a070
commit ac08a887cf
2 changed files with 18 additions and 2 deletions
-2
View File
@@ -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
+18
View File
@@ -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"]]]]]]
```