From 5ab1162def4e6379c84e3363d917252155d9239a Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Fri, 18 Aug 2017 21:46:55 -0700
Subject: [PATCH] Markdown reader: fixed parsing of fenced code after list...

...when there is no intervening blank line.

Closes #3733.
---
 src/Text/Pandoc/Readers/Markdown.hs |  5 ++++-
 test/command/3733.md                | 13 +++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 test/command/3733.md

diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index cc9e9b71f..26263d674 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -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
 
diff --git a/test/command/3733.md b/test/command/3733.md
new file mode 100644
index 000000000..b8a326938
--- /dev/null
+++ b/test/command/3733.md
@@ -0,0 +1,13 @@
+````
+% pandoc -t native
+- Item1
+- Item2
+```yaml
+some: code
+```
+^D
+[BulletList
+ [[Plain [Str "Item1"]]
+ ,[Plain [Str "Item2"]]]
+,CodeBlock ("",["yaml"],[]) "some: code"]
+````