@@ -644,11 +644,14 @@ blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
644 hlCode = if isJust (writerHighlightStyle opts)
644 hlCode = if isJust (writerHighlightStyle opts)
645 then highlight formatHtmlBlock
645 then highlight formatHtmlBlock
646 (id',classes',keyvals) adjCode
646 (id',classes',keyvals) adjCode
647− else Nothing
647+ else Left ""
648 case hlCode of
648 case hlCode of
651+ report $ CouldNotHighlight msg
649− Nothing -> return $ addAttrs opts (id',classes,keyvals)
652+ return $ addAttrs opts (id',classes,keyvals)
650 $ H.pre $ H.code $ toHtml adjCode
653 $ H.pre $ H.code $ toHtml adjCode
651− Just h -> modify (\st -> st{ stHighlighting = True }) >>
654+ Right h -> modify (\st -> st{ stHighlighting = True }) >>
652 return (addAttrs opts (id',[],keyvals) h)
655 return (addAttrs opts (id',[],keyvals) h)
653blockToHtml opts (BlockQuote blocks) = do
656blockToHtml opts (BlockQuote blocks) = do
654 -- in S5, treat list in blockquote specially
657 -- in S5, treat list in blockquote specially
@@ -872,17 +875,19 @@ inlineToHtml opts inline = do
872 (Emph lst) -> inlineListToHtml opts lst >>= return . H.em
875 (Emph lst) -> inlineListToHtml opts lst >>= return . H.em
873 (Strong lst) -> inlineListToHtml opts lst >>= return . H.strong
876 (Strong lst) -> inlineListToHtml opts lst >>= return . H.strong
874 (Code attr str) -> case hlCode of
877 (Code attr str) -> case hlCode of
875− Nothing -> return
878+ Left msg -> do
880+ report $ CouldNotHighlight msg
876− $ addAttrs opts attr
881+ return $ addAttrs opts attr
877− $ H.code $ strToHtml str
882+ $ H.code $ strToHtml str
878− Just h -> do
883+ Right h -> do
879 modify $ \st -> st{ stHighlighting = True }
884 modify $ \st -> st{ stHighlighting = True }
880 return $ addAttrs opts (id',[],keyvals) h
885 return $ addAttrs opts (id',[],keyvals) h
881 where (id',_,keyvals) = attr
886 where (id',_,keyvals) = attr
882 hlCode = if isJust (writerHighlightStyle opts)
887 hlCode = if isJust (writerHighlightStyle opts)
883 then highlight formatHtmlInline
888 then highlight formatHtmlInline
885− else Nothing
890+ else Left ""
886 (Strikeout lst) -> inlineListToHtml opts lst >>=
891 (Strikeout lst) -> inlineListToHtml opts lst >>=
887 return . H.del
892 return . H.del
888 (SmallCaps lst) -> inlineListToHtml opts lst >>=
893 (SmallCaps lst) -> inlineListToHtml opts lst >>=