HTML writer: Don't escape '.

This requires using a custom string escaper. If we use toHtml
from Blaze, we get ', which is pointless unless you're
writing attributes in single quotes.
This commit is contained in:
John MacFarlane 2011-12-17 23:58:15 -08:00
parent eaa41a677a
commit 1c521519d9

View file

@ -36,7 +36,7 @@ import Text.Pandoc.Shared
import Text.Pandoc.Templates
import Text.Pandoc.Readers.TeXMath
import Text.Pandoc.Highlighting ( highlightHtml, defaultHighlightingCss )
import Text.Pandoc.XML (stripTags)
import Text.Pandoc.XML (stripTags, escapeStringForXML)
import Network.HTTP ( urlEncode )
import Numeric ( showHex )
import Data.Char ( ord, toLower )
@ -67,7 +67,8 @@ defaultWriterState = WriterState {stNotes= [], stMath = False, stHighlighting =
-- Helpers to render HTML with the appropriate function.
strToHtml :: String -> Html
strToHtml = toHtml
strToHtml = preEscapedString . escapeStringForXML
-- strToHtml = toHtml
-- | Hard linebreak.
nl :: WriterOptions -> Html