git.iko.soy/typeable/pandoc
on master help sign in
XML: don't use breaking spaces in attribute lists.
commite2548a1317d9b67c7786f52f5b7b91fb3bf6b3c8 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 21 Dec 2010, 16:46 (16 years ago) parentebdbb06
1 file changed+5−4
src/Text/Pandoc/XML.hs+5−4
src/Text/Pandoc/XML.hs+5−4
@@ -34,7 +34,8 @@ module Text.Pandoc.XML ( stripTags,
3434 selfClosingTag,
3535 inTagsSimple,
3636 inTagsIndented ) where
37−import Text.PrettyPrint.HughesPJ
37+
38+import Text.Pandoc.Pretty
3839
3940-- | Remove everything between <...>
4041stripTags :: String -> String
@@ -61,9 +62,9 @@ escapeStringForXML = concatMap escapeCharForXML
6162
6263-- | Return a text object with a string of formatted XML attributes.
6364attributeList :: [(String, String)] -> Doc
64−attributeList = text . concatMap
65− (\(a, b) -> " " ++ escapeStringForXML a ++ "=\"" ++
66− escapeStringForXML b ++ "\"")
65+attributeList = hcat . map
66+ (\(a, b) -> text (' ' : escapeStringForXML a ++ "=\"" ++
67+ escapeStringForXML b ++ "\""))
6768
6869-- | Put the supplied contents between start and end tags of tagType,
6970-- with specified attributes and (if specified) indentation.