Copyright | Copyright (C) 2006-2019 John MacFarlane |
---|---|
License | GNU GPL, version 2 or above |
Maintainer | John MacFarlane <jgm@berkeley.edu> |
Stability | alpha |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Functions for escaping and formatting XML.
Synopsis
- escapeCharForXML :: Char -> String
- escapeStringForXML :: String -> String
- inTags :: Bool -> String -> [(String, String)] -> Doc -> Doc
- selfClosingTag :: String -> [(String, String)] -> Doc
- inTagsSimple :: String -> Doc -> Doc
- inTagsIndented :: String -> Doc -> Doc
- toEntities :: Text -> Text
- toHtml5Entities :: Text -> Text
- fromEntities :: String -> String
Documentation
escapeCharForXML :: Char -> String Source #
Escape one character as needed for XML.
escapeStringForXML :: String -> String Source #
Escape string as needed for XML. Entity references are not preserved.
inTags :: Bool -> String -> [(String, String)] -> Doc -> Doc Source #
Put the supplied contents between start and end tags of tagType, with specified attributes and (if specified) indentation.
selfClosingTag :: String -> [(String, String)] -> Doc Source #
Return a self-closing tag of tagType with specified attributes
inTagsSimple :: String -> Doc -> Doc Source #
Put the supplied contents between start and end tags of tagType.
inTagsIndented :: String -> Doc -> Doc Source #
Put the supplied contents in indented block btw start and end tags.
toEntities :: Text -> Text Source #
Escape all non-ascii characters using numerical entities.
toHtml5Entities :: Text -> Text Source #
Escape all non-ascii characters using HTML5 entities, falling back to numerical entities.
fromEntities :: String -> String Source #