mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-22 07:25:36 +00:00
htmlAttrs: escape id and class attributes, like the others.
This commit is contained in:
@@ -204,10 +204,11 @@ htmlAttrs :: HasChars a => Attr -> Doc a
|
||||
htmlAttrs (ident, classes, kvs) = addSpaceIfNotEmpty (hsep [
|
||||
if T.null ident
|
||||
then empty
|
||||
else "id=" <> doubleQuotes (text $ T.unpack ident)
|
||||
else "id=" <> doubleQuotes (text $ T.unpack (escapeStringForXML ident))
|
||||
,if null classes
|
||||
then empty
|
||||
else "class=" <> doubleQuotes (text $ T.unpack (T.unwords classes))
|
||||
else "class=" <> doubleQuotes
|
||||
(text $ T.unpack . escapeStringForXML $ T.unwords classes)
|
||||
,hsep (map (\(k,v) -> formatKey k <> "=" <>
|
||||
doubleQuotes (text $ T.unpack (escapeStringForXML v))) kvs)
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user