@@ -33,13 +33,13 @@ import Text.Pandoc.ASCIIMathML
3333import Text.Pandoc.CharacterReferences ( decodeCharacterReferences )
3434import Text.Pandoc.Shared
3535import Text.Pandoc.Readers.TeXMath
36+import Text.Pandoc.Highlighting ( highlightHtml )
3637import Numeric ( showHex )
3738import Data.Char ( ord, toLower, isAlpha )
3839import Data.List ( isPrefixOf, intersperse, find )
3940import qualified Data.Set as S
4041import Control.Monad.State
4142import Text.XHtml.Transitional
42−import Text.Highlighting.Kate
4343
4444data WriterState = WriterState
4545 { stNotes :: [Html] -- ^ List of notes
@@ -293,18 +293,12 @@ blockToHtml opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph)
293293blockToHtml opts (RawHtml str) = return $ primHtml str
294294blockToHtml opts (HorizontalRule) = return $ hr
295295blockToHtml opts (CodeBlock (_,classes,_) rawCode) = do
296− let fmtOpts =
297− case find (`elem` ["number","numberLines","number-lines"]) classes of
298− Nothing -> []
299− Just _ -> [OptNumberLines]
300− let toPre str = pre ! (if null classes then [] else [theclass $ unwords classes]) $ thecode << str
301− let lcLanguages = map (map toLower) languages
302− case find (\c -> (map toLower c) `elem` lcLanguages) classes of
303− Nothing -> return $ toPre (rawCode ++ "\n")
304− Just lang -> case highlightAs lang rawCode of
305− Left _ -> return $ toPre (rawCode ++ "\n")
306− Right hl -> do addToCSS highlightingCSS
307− return $ formatAsXHtml fmtOpts lang hl
296+ case highlightHtml classes rawCode of
297+ Left _ -> return $ pre ! (if null classes
298+ then []
299+ else [theclass $ unwords classes]) $ thecode <<
300+ (rawCode ++ "\n")
301+ Right h -> addToCSS highlightingCSS >> return h
308302blockToHtml opts (BlockQuote blocks) =
309303 -- in S5, treat list in blockquote specially
310304 -- if default is incremental, make it nonincremental;