diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-01-01 04:11:54 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-01-01 04:11:54 +0000 |
commit | 41aff1cf5572bb3840aaeaecf1e21fe36e181730 (patch) | |
tree | b0d4d47e4aa6facda74143fdfe74a3280c3892d6 /src/Text/Pandoc | |
parent | 87c66d4623200a48eab6e550f73372aaf3608289 (diff) |
HTML writer: Use functions from XML module to escape strings.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1768 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index c80a3b32f..7d6462148 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -35,7 +35,7 @@ import Text.Pandoc.Shared import Text.Pandoc.Templates import Text.Pandoc.Readers.TeXMath import Text.Pandoc.Highlighting ( highlightHtml ) -import Text.Pandoc.XML (stripTags) +import Text.Pandoc.XML (stripTags, escapeStringForXML) import Numeric ( showHex ) import Data.Char ( ord, toLower ) import Data.List ( isPrefixOf, intersperse ) @@ -63,13 +63,7 @@ renderFragment opts = if writerWrapText opts -- | Modified version of Text.XHtml's stringToHtml. -- Use unicode characters wherever possible. stringToHtml :: String -> Html -stringToHtml = primHtml . concatMap fixChar - where - fixChar '<' = "<" - fixChar '>' = ">" - fixChar '&' = "&" - fixChar '"' = """ - fixChar c = [c] +stringToHtml = primHtml . escapeStringForXML -- | Convert Pandoc document to Html string. writeHtmlString :: WriterOptions -> Pandoc -> String |