From 28c2ee396ccae2693ca50c61fb7f751493787ed0 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Fri, 14 Sep 2007 22:40:28 +0000 Subject: Fixed two bugs in HTML reader: + ... not surrounded by
 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
---
 src/Text/Pandoc/Readers/HTML.hs | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

(limited to 'src/Text/Pandoc')

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
 
-- 
cgit v1.2.3