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
This commit is contained in:
fiddlosopher 2007-09-14 22:40:28 +00:00
parent 85f655c8cb
commit 28c2ee396c

View file

@ -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