summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Highlighting.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-12-15 21:17:32 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-12-17 22:46:03 -0800
commit89c962a18cb354ead249dab3d45e09e3bf9de84e (patch)
treeb63b768f7ce22c0e3b336952f2cce19f25d3a24d /src/Text/Pandoc/Highlighting.hs
parentd78e9c1dac731b737daadcba7f94f81acbbe5d3c (diff)
Use blaze-html instead of xhtml for HTML generation.
* This is a breaking API change for `writeHtml`. * It introduces a new dependency on blaze-html. * Pandoc now depends on highlighting-kate >= 0.4, which also uses blaze-html. * The --ascii option has been removed, because of differences in blaze-html's and xhtml's escaping. * Pandoc will no longer transform leading newlines in code blocks to `<br/>` tags.
Diffstat (limited to 'src/Text/Pandoc/Highlighting.hs')
-rw-r--r--src/Text/Pandoc/Highlighting.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Highlighting.hs b/src/Text/Pandoc/Highlighting.hs
index 5ddaf1379..f80ebeac7 100644
--- a/src/Text/Pandoc/Highlighting.hs
+++ b/src/Text/Pandoc/Highlighting.hs
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- |
Module : Text.Pandoc.Highlighting
Copyright : Copyright (C) 2008 John MacFarlane
- License : GNU GPL, version 2 or above
+ License : GNU GPL, version 2 or above
Maintainer : John MacFarlane <jgm@berkeley.edu>
Stability : alpha
@@ -29,10 +29,10 @@ Exports functions for syntax highlighting.
-}
module Text.Pandoc.Highlighting ( languages, highlightHtml, defaultHighlightingCss, languagesByExtension ) where
-import Text.XHtml
+import Text.Blaze
import Text.Pandoc.Definition
#ifdef _HIGHLIGHTING
-import Text.Highlighting.Kate ( languages, highlightAs, formatAsXHtml, FormatOption (..), defaultHighlightingCss, languagesByExtension )
+import Text.Highlighting.Kate ( languages, highlightAs, formatAsHtml, FormatOption (..), defaultHighlightingCss, languagesByExtension )
import Data.List (find)
import Data.Maybe (fromMaybe)
import Data.Char (toLower)
@@ -54,9 +54,9 @@ highlightHtml inline (_, classes, keyvals) rawCode =
Nothing -> Left "Unknown or unsupported language"
Just language -> case highlightAs language rawCode of
Left err -> Left err
- Right hl -> Right $ formatAsXHtml fmtOpts language $
+ Right hl -> Right $ formatAsHtml fmtOpts language $
if addBirdTracks
- then map ((["Special"],"> "):) hl
+ then map (("ot","> "):) hl
else hl
#else