Fixed over-eager raw HTML inline parsing.

Tightened up the inline HTML parser so it disallows
TagWarnings.

This only affects the markdown reader when the `markdown_in_html_blocks`
option is disabled.

Closes #2469.
This commit is contained in:
John MacFarlane
2015-10-22 21:18:06 -07:00
parent a21833b638
commit a7150bb6b6
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -948,6 +948,7 @@ htmlTag f = try $ do
parseOptions{ optTagWarning = True } inp
guard $ f next
case next of
TagWarning _ -> fail "encountered TagWarning"
TagComment s
| "<!--" `isPrefixOf` inp -> do
count (length s + 4) anyChar
+3
View File
@@ -181,6 +181,9 @@ tests = [ testGroup "inline code"
, "technically invalid comment" =:
"<!-- pandoc --help -->" =?>
rawBlock "html" "<!-- pandoc --help -->"
, test markdownGH "issue 2469" $
"<\n\na>" =?>
para (text "<") <> para (text "a>")
]
, "unbalanced brackets" =:
"[[[[[[[[[[[[[[[hi" =?> para (text "[[[[[[[[[[[[[[[hi")