summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2022-03-30 09:48:56 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2022-03-30 09:48:56 -0700
commitbb5f0f7b761fbee084af4cc06210efd0331cd048 (patch)
treea57484d5437bd11a2e366293732874fe6cdcca6a /src
parent4a54ca5b0bef237c5abd61fbd75cb84ce301c605 (diff)
HTML writer: Further performance improvements.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index f62da8058..f443c446b 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -991,7 +991,7 @@ blockToHtmlInner opts (Header level (ident,classes,kvs) lst) = do
let contents' = if writerNumberSections opts && not (T.null secnum)
&& "unnumbered" `notElem` classes
then (H.span ! A.class_ "header-section-number"
- $ toHtml secnum) >> strToHtml " " >> contents
+ $ toHtml secnum) >> toHtml ' ' >> contents
else contents
html5 <- gets stHtml5
let kvs' = if html5
@@ -1373,14 +1373,14 @@ inlineToHtml opts inline = do
html5 <- gets stHtml5
case inline of
(Str str) -> return $ strToHtml str
- Space -> return $ strToHtml " "
+ Space -> return $ toHtml ' '
SoftBreak -> return $ case writerWrapText opts of
- WrapNone -> " "
- WrapAuto -> " "
- WrapPreserve -> nl
+ WrapNone -> toHtml ' '
+ WrapAuto -> toHtml ' '
+ WrapPreserve -> toHtml '\n'
LineBreak -> return $ do
if html5 then H5.br else H.br
- strToHtml "\n"
+ toHtml '\n'
(Span ("",[cls],[]) ils)
| cls == "csl-block" || cls == "csl-left-margin" ||
cls == "csl-right-inline" || cls == "csl-indent"
@@ -1449,10 +1449,10 @@ inlineToHtml opts inline = do
(Subscript lst) -> H.sub <$> inlineListToHtml opts lst
(Quoted quoteType lst) ->
let (leftQuote, rightQuote) = case quoteType of
- SingleQuote -> (strToHtml "‘",
- strToHtml "’")
- DoubleQuote -> (strToHtml "“",
- strToHtml "”")
+ SingleQuote -> (toHtml '‘',
+ toHtml '’')
+ DoubleQuote -> (toHtml '“',
+ toHtml '”')
in if writerHtmlQTags opts
then do