diff --git a/Text/Markdown.hs b/Text/Markdown.hs
--- a/Text/Markdown.hs
+++ b/Text/Markdown.hs
@@ -9,6 +9,7 @@
     , msXssProtect
     , msStandaloneHtml
     , msFencedHandlers
+    , msBlockCodeRenderer
       -- * Newtype
     , Markdown (..)
       -- * Fenced handlers
@@ -19,6 +20,7 @@
     , def
     ) where
 
+import Control.Arrow ((&&&))
 import Text.Markdown.Inline
 import Text.Markdown.Block
 import Text.Markdown.Types
@@ -117,8 +119,7 @@
     go (BlockList _ (Left h)) = H.li h
     go (BlockList _ (Right bs)) = H.li $ blocksToHtml bs
     go (BlockHtml t) = escape t
-    go (BlockCode Nothing t) = H.pre $ H.code $ toMarkup t
-    go (BlockCode (Just lang) t) = H.pre $ H.code H.! HA.class_ (H.toValue lang) $ toMarkup t
+    go (BlockCode a b) = msBlockCodeRenderer ms a (id &&& toMarkup $ b)
     go (BlockQuote bs) = H.blockquote $ blocksToHtml bs
     go BlockRule = H.hr
     go (BlockHeading level h) =
diff --git a/Text/Markdown/Types.hs b/Text/Markdown/Types.hs
--- a/Text/Markdown/Types.hs
+++ b/Text/Markdown/Types.hs
@@ -7,6 +7,9 @@
 import Data.Set (Set, empty)
 import Data.Map (Map, singleton)
 import Data.Monoid (mappend)
+import Text.Blaze.Html (Html)
+import qualified Text.Blaze.Html5 as H
+import qualified Text.Blaze.Html5.Attributes as HA
 
 -- | A settings type providing various configuration options.
 --
@@ -47,6 +50,21 @@
       -- Default: code fencing for @```@ and @~~~@.
       --
       -- Since: 0.1.2
+    , msBlockCodeRenderer :: Maybe Text -> (Text,Html) -> Html
+      -- ^ A rendering function through which code blocks are passed.
+      --
+      -- The arguments are the block's language, if any, and the tuple
+      -- @(unrendered content, rendered content)@. For example, if you wanted to pass
+      -- code blocks in your markdown text through a highlighter like @highlighting-kate@,
+      -- you might do something like:
+      --
+      -- >>> :set -XOverloadedStrings
+      -- >>> let renderer lang (src,_) = formatHtmlBlock defaultFormatOpts $ highlightAs (maybe "text" unpack lang) $ unpack src
+      -- >>> let md = markdown def { msBlockCodeRenderer = renderer } "``` haskell\nmain = putStrLn \"Hello world!\"\n```"
+      -- >>> putStrLn $ renderHtml md
+      -- <pre class="sourceCode"><code class="sourceCode">main <span class="fu">=</span> <span class="fu">putStrLn</span> <span class="st">&quot;Hello world!&quot;</span></code></pre>
+      --
+      -- Since: 0.1.2.1
     }
 
 -- | See 'msFencedHandlers.
@@ -62,6 +80,10 @@
         { msXssProtect = True
         , msStandaloneHtml = empty
         , msFencedHandlers = codeFencedHandler "```" `mappend` codeFencedHandler "~~~"
+        , msBlockCodeRenderer =
+            \lang (_,rendered) -> case lang of
+                                       Just l -> H.pre $ H.code H.! HA.class_ (H.toValue l) $ rendered
+                                       Nothing -> H.pre $ H.code $ rendered
         }
 
 -- | Helper for creating a 'FHRaw'.
diff --git a/markdown.cabal b/markdown.cabal
--- a/markdown.cabal
+++ b/markdown.cabal
@@ -1,5 +1,5 @@
 Name:                markdown
-Version:             0.1.2.1
+Version:             0.1.3
 Synopsis:            Convert Markdown to HTML, with XSS protection
 Description:         This library leverages existing high-performance libraries (attoparsec, blaze-html, text, and conduit), and should integrate well with existing codebases.
 Homepage:            https://github.com/snoyberg/markdown
diff --git a/test/main.hs b/test/main.hs
--- a/test/main.hs
+++ b/test/main.hs
@@ -1,4 +1,6 @@
 {-# LANGUAGE OverloadedStrings #-}
+import Text.Blaze.Html (toHtml)
+import Text.Blaze.Html5 (figure)
 import Test.Hspec
 import Text.Markdown
 import Data.Text.Lazy (Text, unpack, snoc, fromStrict)
@@ -99,6 +101,11 @@
             $ check
                 "<pre><code>foo\n bar\nbaz</code></pre>"
                 "    foo\n     bar\n    baz"
+        it "custom renderer"
+            $ checkSet
+                def { msBlockCodeRenderer = (\_ (u,_) -> figure (toHtml u)) }
+                "<figure>foo\n bar\nbaz</figure>"
+                "```haskell\nfoo\n bar\nbaz\n```"
     describe "escaping" $ do
         it "everything"
             $ check
