Skip to content

Commit

Permalink
Markdown reader: fixed parsing of fenced code after list...
Browse files Browse the repository at this point in the history
...when there is no intervening blank line.

Closes #3733.
  • Loading branch information
jgm committed Aug 19, 2017
1 parent fbb79c1 commit 5ab1162
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Text/Pandoc/Readers/Markdown.hs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,10 @@ rawListItem :: PandocMonad m
rawListItem start = try $ do
start
first <- listLineCommon
rest <- many (notFollowedBy listStart >> notFollowedBy blankline >> listLine)
rest <- many (do notFollowedBy listStart
notFollowedBy (() <$ codeBlockFenced)
notFollowedBy blankline
listLine)
blanks <- many blankline
return $ unlines (first:rest) ++ blanks

Expand Down
13 changes: 13 additions & 0 deletions test/command/3733.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
````
% pandoc -t native
- Item1
- Item2
```yaml
some: code
```
^D
[BulletList
[[Plain [Str "Item1"]]
,[Plain [Str "Item2"]]]
,CodeBlock ("",["yaml"],[]) "some: code"]
````

0 comments on commit 5ab1162

Please sign in to comment.