summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-12-22 00:33:38 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-12-22 00:33:38 -0800
commit7046cef26398acc6f1f1252533ed7591bd5118a8 (patch)
tree0818557a2638a3b3c0702739cb323d41a8b46da4 /src/Text/Pandoc/Writers/HTML.hs
parent1cefff63195087b3b3c672253b615c699cbe4922 (diff)
Changed types of highlighting functions.
* highlightLaTeX, highlightHtml now return Maybe, not Either. * This is because h-k's higdlightAs no longer returns an Either.
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 64a1c993d..96fa5e906 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -365,13 +365,13 @@ blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
then classes
else filter (/= "literate") classes
case highlightHtml False (id',classes',keyvals) rawCode of
- Left _ -> let attrs = attrsToHtml opts (id', classes', keyvals)
+ Nothing -> let attrs = attrsToHtml opts (id', classes', keyvals)
addBird = if "literate" `elem` classes'
then unlines . map ("> " ++) . lines
else unlines . lines
in return $ foldl (!) H.pre attrs $ H.code
$ toHtml $ addBird rawCode
- Right h -> modify (\st -> st{ stHighlighting = True }) >>
+ Just h -> modify (\st -> st{ stHighlighting = True }) >>
return h
blockToHtml opts (BlockQuote blocks) =
-- in S5, treat list in blockquote specially
@@ -541,10 +541,10 @@ inlineToHtml opts inline =
(Emph lst) -> inlineListToHtml opts lst >>= return . H.em
(Strong lst) -> inlineListToHtml opts lst >>= return . H.strong
(Code attr str) -> case highlightHtml True attr str of
- Left _ -> return
+ Nothing -> return
$ foldl (!) H.code (attrsToHtml opts attr)
$ strToHtml str
- Right h -> return h
+ Just h -> return h
(Strikeout lst) -> inlineListToHtml opts lst >>=
return . H.del
(SmallCaps lst) -> inlineListToHtml opts lst >>=