packages feed

highlighter 0.2.1 → 0.2.2

raw patch · 2 files changed

+9/−8 lines, 2 filesdep ~blaze-htmlPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: blaze-html

API changes (from Hackage documentation)

Files

highlighter.cabal view
@@ -1,5 +1,5 @@ name:                highlighter-version:             0.2.1+version:             0.2.2 synopsis:            source code highlighting description:     Processes source code using tons of lexers, tokenizing it and formatting it as e.g. HTML.@@ -147,7 +147,7 @@    build-depends:     { base >= 4 && < 5-    , blaze-html < 0.5+    , blaze-html     , bytestring     , filepath     , mtl@@ -168,7 +168,7 @@    build-depends:     { base >= 4 && < 5-    , blaze-html < 0.5+    , blaze-html     , bytestring     , filepath     , mtl
src/Text/Highlighter/Formatters/Html.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} module Text.Highlighter.Formatters.Html (format, formatInline) where +import Data.Text (Text) import Data.Text.Encoding (decodeUtf8) import Prelude hiding (div, span) import Text.Blaze.Html5@@ -31,7 +32,7 @@ highlight :: [Token] -> Html highlight [] = return () highlight (Token t s:ts) = do-    span ! class_ (stringValue $ shortName t) $ text (decodeUtf8 s)+    span ! class_ (toValue $ shortName t) $ toHtml (decodeUtf8 s)     highlight ts  countLines :: [Token] -> Int@@ -44,11 +45,11 @@   where     lineNos' c         | c <= n = do-            a ! href (stringValue $ "#L-" ++ show c)-              ! name (stringValue $ "L-" ++ show c) $-                string (show c)+            a ! href (toValue $ "#L-" ++ show c)+              ! name (toValue $ "L-" ++ show c) $+                toHtml (show c) -            string "\n"+            toHtml ("\n" :: Text)              lineNos' (c + 1)         | otherwise = return ()