mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
XML: don't use breaking spaces in attribute lists.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user