diff --git a/Text/Markdown.hs b/Text/Markdown.hs
--- a/Text/Markdown.hs
+++ b/Text/Markdown.hs
@@ -12,6 +12,7 @@
     , msBlockCodeRenderer
     , msLinkNewTab
     , msBlankBeforeBlockquote
+    , msBlockFilter
       -- * Newtype
     , Markdown (..)
       -- * Fenced handlers
@@ -69,17 +70,19 @@
     sanitize
         | msXssProtect ms = preEscapedToMarkup . sanitizeBalance . TL.toStrict . renderHtml
         | otherwise = id
-    fixBlock :: Block Text -> Block Html
-    fixBlock = fmap $ toHtmlI ms . toInline refs
-
     blocksH :: [Block Html]
-    blocksH = map fixBlock blocks
+    blocksH = processBlocks blocks
 
     blocks :: [Block Text]
     blocks = runIdentity
            $ CL.sourceList (TL.toChunks tl)
           $$ toBlocks ms
           =$ CL.consume
+
+    processBlocks :: [Block Text] -> [Block Html]
+    processBlocks = map (fmap $ toHtmlI ms)
+                  . msBlockFilter ms
+                  . map (fmap $ toInline refs)
 
     refs =
         Map.unions $ map toRef blocks
diff --git a/Text/Markdown/Inline.hs b/Text/Markdown/Inline.hs
--- a/Text/Markdown/Inline.hs
+++ b/Text/Markdown/Inline.hs
@@ -13,6 +13,7 @@
 import Control.Applicative
 import Data.Monoid (Monoid, mappend)
 import qualified Data.Map as Map
+import Text.Markdown.Types (Inline(..))
 
 type RefMap = Map.Map Text Text
 
@@ -25,16 +26,6 @@
 (<>) :: Monoid m => m -> m -> m
 (<>) = mappend
 
-data Inline = InlineText Text
-            | InlineItalic [Inline]
-            | InlineBold [Inline]
-            | InlineCode Text
-            | InlineHtml Text
-            | InlineLink Text (Maybe Text) [Inline] -- ^ URL, title, content
-            | InlineImage Text (Maybe Text) Text -- ^ URL, title, content
-            | InlineFootnoteRef Integer -- ^ The footnote reference in the body
-            | InlineFootnote Integer
-    deriving (Show, Eq)
 
 inlineParser :: RefMap -> Parser [Inline]
 inlineParser = fmap combine . many . inlineAny
diff --git a/Text/Markdown/Types.hs b/Text/Markdown/Types.hs
--- a/Text/Markdown/Types.hs
+++ b/Text/Markdown/Types.hs
@@ -81,6 +81,13 @@
       -- Default: @True@
       --
       -- Since 0.1.5
+    , msBlockFilter :: [Block [Inline]] -> [Block [Inline]]
+      -- ^ A function to filter and/or modify parsed blocks before they are
+      -- written to Html
+      --
+      -- Default: @id@
+      --
+      -- Since 0.1.7
     }
 
 -- | See 'msFencedHandlers.
@@ -102,6 +109,7 @@
                                        Nothing -> H.pre $ H.code $ rendered
         , msLinkNewTab = False
         , msBlankBeforeBlockquote = True
+        , msBlockFilter = id
         }
 
 -- | Helper for creating a 'FHRaw'.
@@ -157,3 +165,14 @@
     fmap f (BlockHeading level i) = BlockHeading level (f i)
     fmap _ (BlockReference x y) = BlockReference x y
     fmap f (BlockPlainText x) = BlockPlainText (f x)
+
+data Inline = InlineText Text
+            | InlineItalic [Inline]
+            | InlineBold [Inline]
+            | InlineCode Text
+            | InlineHtml Text
+            | InlineLink Text (Maybe Text) [Inline] -- ^ URL, title, content
+            | InlineImage Text (Maybe Text) Text -- ^ URL, title, content
+            | InlineFootnoteRef Integer -- ^ The footnote reference in the body
+            | InlineFootnote Integer
+    deriving (Show, Eq)
diff --git a/markdown.cabal b/markdown.cabal
--- a/markdown.cabal
+++ b/markdown.cabal
@@ -1,5 +1,5 @@
 Name:                markdown
-Version:             0.1.6.1
+Version:             0.1.7
 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
