mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-28 11:16:33 +00:00
Gobble space after Plain blocks containing only raw html inline.
Otherwise following header blocks are not parsed correctly, since the parser sees blank space before them. Resolves Issue #124. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1534 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
@@ -612,7 +612,7 @@ para = try $ do
|
||||
return $ Para $ normalizeSpaces result
|
||||
|
||||
plain :: GenParser Char ParserState Block
|
||||
plain = many1 inline >>= return . Plain . normalizeSpaces
|
||||
plain = many1 inline >>~ spaces >>= return . Plain . normalizeSpaces
|
||||
|
||||
--
|
||||
-- raw html
|
||||
|
||||
@@ -10,5 +10,8 @@ Pandoc (Meta [] [] "")
|
||||
, Para [Link [Str "baz"] ("/foo%20foo",""),Space,Link [Str "bam"] ("/foo%20fee",""),Space,Link [Str "bork"] ("/foo/zee%20zob","title")]
|
||||
, Header 2 [Str "Horizontal",Space,Str "rules",Space,Str "with",Space,Str "spaces",Space,Str "at",Space,Str "end"]
|
||||
, HorizontalRule
|
||||
, HorizontalRule ]
|
||||
, HorizontalRule
|
||||
, Header 2 [Str "Raw",Space,Str "HTML",Space,Str "before",Space,Str "header"]
|
||||
, Plain [HtmlInline "<a>",HtmlInline "</a>"]
|
||||
, Header 3 [Str "my",Space,Str "header"] ]
|
||||
|
||||
|
||||
@@ -41,3 +41,9 @@
|
||||
|
||||
-- - -- -- -
|
||||
|
||||
## Raw HTML before header
|
||||
|
||||
<a></a>
|
||||
|
||||
### my header
|
||||
|
||||
|
||||
Reference in New Issue
Block a user