Properly handle commented-out list items in markdown.

Example:
- a
<!--
- b
-->
- c

Resolves Issue #142.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1615 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher
2009-11-01 02:38:15 +00:00
parent a4a5d41441
commit eb2e560d86
4 changed files with 17 additions and 4 deletions
+1
View File
@@ -38,6 +38,7 @@ module Text.Pandoc.Readers.HTML (
htmlEndTag,
extractTagType,
htmlBlockElement,
htmlComment,
unsanitaryURI
) where
+3 -3
View File
@@ -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]
+5 -1
View File
@@ -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"] ] ] ]
+8
View File
@@ -51,3 +51,11 @@
$\$2 + \$3$
## Commented-out list item
- one
<!--
- two
-->
- three