aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-04-14 22:53:08 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-04-14 22:53:08 -0700
commita0424d2f8292f5530fe6f2c80b83ba300489615b (patch)
treea114153a1ee83519f9c26f334f8595d82c20e973 /src/Text/Pandoc
parente2c3a7b896b076a218d94b9b0840599d399b0618 (diff)
parentf40b2eb2e763ed08768e08394e5a131bd4373126 (diff)
downloadpandoc-a0424d2f8292f5530fe6f2c80b83ba300489615b.tar.gz
Merge branch 'master' into docbookreader
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/XML.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/XML.hs b/src/Text/Pandoc/XML.hs
index 7a1c8bdd8..31279c3bb 100644
--- a/src/Text/Pandoc/XML.hs
+++ b/src/Text/Pandoc/XML.hs
@@ -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