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:
parent
85f655c8cb
commit
28c2ee396c
1 changed files with 4 additions and 11 deletions
|
@ -151,8 +151,7 @@ htmlAttribute = htmlRegularAttribute <|> htmlMinimizedAttribute
|
||||||
htmlMinimizedAttribute = try $ do
|
htmlMinimizedAttribute = try $ do
|
||||||
many1 space
|
many1 space
|
||||||
name <- many1 (choice [letter, oneOf ".-_:"])
|
name <- many1 (choice [letter, oneOf ".-_:"])
|
||||||
spaces
|
notFollowedBy (spaces >> char '=')
|
||||||
notFollowedBy (char '=')
|
|
||||||
let content = name
|
let content = name
|
||||||
return (name, content, (" " ++ name))
|
return (name, content, (" " ++ name))
|
||||||
|
|
||||||
|
@ -319,19 +318,13 @@ hrule = try $ do
|
||||||
-- code blocks
|
-- code blocks
|
||||||
--
|
--
|
||||||
|
|
||||||
codeBlock = preCodeBlock <|> bareCodeBlock <?> "code block"
|
codeBlock = try $ do
|
||||||
|
|
||||||
preCodeBlock = try $ do
|
|
||||||
htmlTag "pre"
|
htmlTag "pre"
|
||||||
spaces
|
spaces
|
||||||
result <- bareCodeBlock
|
|
||||||
spaces
|
|
||||||
htmlEndTag "pre"
|
|
||||||
return result
|
|
||||||
|
|
||||||
bareCodeBlock = try $ do
|
|
||||||
htmlTag "code"
|
htmlTag "code"
|
||||||
result <- manyTill anyChar (htmlEndTag "code")
|
result <- manyTill anyChar (htmlEndTag "code")
|
||||||
|
spaces
|
||||||
|
htmlEndTag "pre"
|
||||||
return $ CodeBlock $ stripTrailingNewlines $
|
return $ CodeBlock $ stripTrailingNewlines $
|
||||||
decodeCharacterReferences result
|
decodeCharacterReferences result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue