From e2548a1317d9b67c7786f52f5b7b91fb3bf6b3c8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Dec 2010 16:46:21 -0800 Subject: XML: don't use breaking spaces in attribute lists. --- src/Text/Pandoc/XML.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Text') 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. -- cgit v1.2.3