diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-12-31 01:02:44 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-12-31 01:02:44 +0000 |
commit | e37df6db69fc1d7832db19316ca7beb9cd54a24b (patch) | |
tree | f8634bade2559c2cc510f294de7da2c1336b74f7 /Text/Pandoc/Readers/HTML.hs | |
parent | ad5cbb78d0256a9394d73aa594a838278b7a8c81 (diff) | |
download | pandoc-e37df6db69fc1d7832db19316ca7beb9cd54a24b.tar.gz |
Fixed bug in the markdown reader: HTML preceding a code block
could cause it to be parsed as a paragraph. (The problem is that
the HTML parser used to eat all blank space after an HTML block,
including the indentation of the code block.) Resolves Issue #39.
+ In Text.Pandoc.Readers.HTML, removed parsing of following space
from rawHtmlBlock.
+ In Text.Pandoc.Readers.Markdown, modified rawHtmlBlocks so that
indentation is eaten *only* on the first line after the HTML
block. This means that in
<div>
foo
<div>
the foo won't be treated as a code block, but in
<div>
foo
</div>
it will. This seems the right approach for least suprise.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1164 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Text/Pandoc/Readers/HTML.hs')
-rw-r--r-- | Text/Pandoc/Readers/HTML.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Text/Pandoc/Readers/HTML.hs b/Text/Pandoc/Readers/HTML.hs index 1d04c74e0..1fff4705f 100644 --- a/Text/Pandoc/Readers/HTML.hs +++ b/Text/Pandoc/Readers/HTML.hs @@ -207,9 +207,8 @@ htmlBlockElement = choice [ htmlScript, htmlStyle, htmlComment, xmlDec, definiti rawHtmlBlock = try $ do body <- htmlBlockElement <|> anyHtmlTag <|> anyHtmlEndTag - sp <- many space state <- getState - if stateParseRaw state then return (RawHtml (body ++ sp)) else return Null + if stateParseRaw state then return (RawHtml body) else return Null -- We don't want to parse </body> or </html> as raw HTML, since these -- are handled in parseHtml. |