aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-12-21 16:46:21 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-21 16:46:21 -0800
commite2548a1317d9b67c7786f52f5b7b91fb3bf6b3c8 (patch)
treefa0c3f4f9ab4c5a2add52ba046ff7dee84e897d2 /src/Text
parentebdbb06f94dec28eac480021c7784218cd9af43b (diff)
downloadpandoc-e2548a1317d9b67c7786f52f5b7b91fb3bf6b3c8.tar.gz
XML: don't use breaking spaces in attribute lists.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/XML.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Text/Pandoc/XML.hs b/src/Text/Pandoc/XML.hs
index 426521baa..e21525018 100644
--- a/src/Text/Pandoc/XML.hs
+++ b/src/Text/Pandoc/XML.hs
@@ -34,7 +34,8 @@ module Text.Pandoc.XML ( stripTags,
selfClosingTag,
inTagsSimple,
inTagsIndented ) where
-import Text.PrettyPrint.HughesPJ
+
+import Text.Pandoc.Pretty
-- | Remove everything between <...>
stripTags :: String -> String
@@ -61,9 +62,9 @@ escapeStringForXML = concatMap escapeCharForXML
-- | Return a text object with a string of formatted XML attributes.
attributeList :: [(String, String)] -> Doc
-attributeList = text . concatMap
- (\(a, b) -> " " ++ escapeStringForXML a ++ "=\"" ++
- escapeStringForXML b ++ "\"")
+attributeList = hcat . map
+ (\(a, b) -> text (' ' : escapeStringForXML a ++ "=\"" ++
+ escapeStringForXML b ++ "\""))
-- | Put the supplied contents between start and end tags of tagType,
-- with specified attributes and (if specified) indentation.