diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-09-14 22:40:28 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-09-14 22:40:28 +0000 |
commit | 28c2ee396ccae2693ca50c61fb7f751493787ed0 (patch) | |
tree | b48362dca1f2887008e435d1cb7764496b6ba0df /src/Text/Pandoc | |
parent | 85f655c8cb76ccca36595e2cc9c26bea4a3b10dd (diff) | |
download | pandoc-28c2ee396ccae2693ca50c61fb7f751493787ed0.tar.gz |
Fixed two bugs in HTML reader:
+ <code>...</code> not surrounded by <pre> should count as
inline HTML, not code block.
+ parser for minimized attributes should not swallow trailing spaces
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1015 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index caf2b7f5f..80ef01da7 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -151,8 +151,7 @@ htmlAttribute = htmlRegularAttribute <|> htmlMinimizedAttribute htmlMinimizedAttribute = try $ do many1 space name <- many1 (choice [letter, oneOf ".-_:"]) - spaces - notFollowedBy (char '=') + notFollowedBy (spaces >> char '=') let content = name return (name, content, (" " ++ name)) @@ -319,19 +318,13 @@ hrule = try $ do -- code blocks -- -codeBlock = preCodeBlock <|> bareCodeBlock <?> "code block" - -preCodeBlock = try $ do +codeBlock = try $ do htmlTag "pre" spaces - result <- bareCodeBlock - spaces - htmlEndTag "pre" - return result - -bareCodeBlock = try $ do htmlTag "code" result <- manyTill anyChar (htmlEndTag "code") + spaces + htmlEndTag "pre" return $ CodeBlock $ stripTrailingNewlines $ decodeCharacterReferences result |