Permalink
Browse files

Merge branch 'master' into docbookreader

  • Loading branch information...
2 parents e2c3a7b + f40b2eb commit a0424d2f8292f5530fe6f2c80b83ba300489615b John MacFarlane committed Apr 15, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/Text/Pandoc/XML.hs
View
@@ -38,7 +38,7 @@ module Text.Pandoc.XML ( stripTags,
fromEntities ) where
import Text.Pandoc.Pretty
-import Data.Char (ord, isAscii)
+import Data.Char (ord, isAscii, isSpace)
import Text.HTML.TagSoup.Entity (lookupEntity)
-- | Remove everything between <...>
@@ -106,8 +106,8 @@ fromEntities :: String -> String
fromEntities ('&':xs) =
case lookupEntity ent of
Just c -> c : fromEntities rest
- Nothing -> '&' : fromEntities rest
- where (ent, rest) = case break (==';') xs of
+ Nothing -> '&' : fromEntities xs
+ where (ent, rest) = case break (\c -> isSpace c || c == ';') xs of
(zs,';':ys) -> (zs,ys)
_ -> ("",xs)
fromEntities (x:xs) = x : fromEntities xs

0 comments on commit a0424d2

Please sign in to comment.