diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-11-01 02:38:15 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-11-01 02:38:15 +0000 |
commit | eb2e560d861387414fe03056189f32e54e83851b (patch) | |
tree | 7406dbb1c696007134365e6c015eafb370bc6739 /src/Text/Pandoc | |
parent | a4a5d41441d32a318c658fa8503309576843ce1c (diff) | |
download | pandoc-eb2e560d861387414fe03056189f32e54e83851b.tar.gz |
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
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 1 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 6 |
2 files changed, 4 insertions, 3 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] |