aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs1
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs6
-rw-r--r--tests/markdown-reader-more.native6
-rw-r--r--tests/markdown-reader-more.txt8
4 files changed, 17 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 2e38da722..e1f1e1af5 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -38,6 +38,7 @@ module Text.Pandoc.Readers.HTML (
htmlEndTag,
extractTagType,
htmlBlockElement,
+ htmlComment,
unsanitaryURI
) where
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index d03a1123f..3f2865d66 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -42,7 +42,7 @@ import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXEnvironment' )
import Text.Pandoc.Readers.HTML ( rawHtmlBlock, anyHtmlBlockTag,
anyHtmlInlineTag, anyHtmlTag,
anyHtmlEndTag, htmlEndTag, extractTagType,
- htmlBlockElement, unsanitaryURI )
+ htmlBlockElement, htmlComment, unsanitaryURI )
import Text.Pandoc.CharacterReferences ( decodeCharacterReferences )
import Text.ParserCombinators.Parsec
import Control.Monad (when, liftM)
@@ -504,8 +504,8 @@ listLine = try $ do
notFollowedBy' (do indentSpaces
many (spaceChar)
listStart)
- line <- manyTill anyChar newline
- return $ line ++ "\n"
+ chunks <- manyTill (htmlComment <|> count 1 anyChar) newline
+ return $ concat chunks ++ "\n"
-- parse raw text for one list item, excluding start marker and continuations
rawListItem :: GenParser Char ParserState [Char]
diff --git a/tests/markdown-reader-more.native b/tests/markdown-reader-more.native
index 995991a17..bf8eb98f8 100644
--- a/tests/markdown-reader-more.native
+++ b/tests/markdown-reader-more.native
@@ -15,5 +15,9 @@ Pandoc (Meta [] [] "")
, Plain [HtmlInline "<a>",HtmlInline "</a>"]
, Header 3 [Str "my",Space,Str "header"]
, Header 2 [Str "$",Space,Str "in",Space,Str "math"]
-, Para [Math InlineMath "\\$2 + \\$3"] ]
+, Para [Math InlineMath "\\$2 + \\$3"]
+, Header 2 [Str "Commented",Str "-",Str "out",Space,Str "list",Space,Str "item"]
+, BulletList
+ [ [ Plain [Str "one"]
+ , RawHtml "<!--\n- two\n-->" ], [ Plain [Str "three"] ] ] ]
diff --git a/tests/markdown-reader-more.txt b/tests/markdown-reader-more.txt
index a7d64dde9..02b425e11 100644
--- a/tests/markdown-reader-more.txt
+++ b/tests/markdown-reader-more.txt
@@ -51,3 +51,11 @@
$\$2 + \$3$
+## Commented-out list item
+
+- one
+<!--
+- two
+-->
+- three
+