git.iko.soy/typeable/pandoc
on master help sign in
Fixed two bugs in HTML reader:
28c2ee3fiddlosopher
src/Text/Pandoc/Readers/HTML.hs+4−11
@@ -151,8 +151,7 @@ htmlAttribute = htmlRegularAttribute <|> htmlMinimizedAttribute
151htmlMinimizedAttribute = try $ do
151htmlMinimizedAttribute = try $ do
152 many1 space
152 many1 space
153 name <- many1 (choice [letter, oneOf ".-_:"])
153 name <- many1 (choice [letter, oneOf ".-_:"])
154− spaces
155− notFollowedBy (char '=')
154+ notFollowedBy (spaces >> char '=')
156 let content = name
155 let content = name
157 return (name, content, (" " ++ name))
156 return (name, content, (" " ++ name))
158
157
@@ -319,19 +318,13 @@ hrule = try $ do
319-- code blocks
318-- code blocks
320--
319--
321
320
322−codeBlock = preCodeBlock <|> bareCodeBlock <?> "code block"
321+codeBlock = try $ do
323−
324−preCodeBlock = try $ do
325 htmlTag "pre"
322 htmlTag "pre"
326 spaces
323 spaces
327− result <- bareCodeBlock
328− spaces
329− htmlEndTag "pre"
330− return result
331−
332−bareCodeBlock = try $ do
333 htmlTag "code"
324 htmlTag "code"
334 result <- manyTill anyChar (htmlEndTag "code")
325 result <- manyTill anyChar (htmlEndTag "code")
326+ spaces
327+ htmlEndTag "pre"
335 return $ CodeBlock $ stripTrailingNewlines $
328 return $ CodeBlock $ stripTrailingNewlines $
336 decodeCharacterReferences result
329 decodeCharacterReferences result
337
330