diff --git a/Text/Hamlet/Monad.hs b/Text/Hamlet/Monad.hs
--- a/Text/Hamlet/Monad.hs
+++ b/Text/Hamlet/Monad.hs
@@ -15,6 +15,7 @@
     , outputUrlParams
     , outputEmbed
       -- * Utility functions
+    , htmlContentToText
     , showUrl
     , liftHamlet
     , mapH
@@ -236,3 +237,8 @@
     return $ L.fromChunks $ front []
   where
     iter front text = return $ Right $ front . (:) text
+
+-- | Returns HTML-ready text (ie, all entities are escaped properly).
+htmlContentToText :: HtmlContent -> Text
+htmlContentToText (Encoded t) = t
+htmlContentToText (Unencoded t) = encodeHtml t
diff --git a/hamlet.cabal b/hamlet.cabal
--- a/hamlet.cabal
+++ b/hamlet.cabal
@@ -1,5 +1,5 @@
 name:            hamlet
-version:         0.2.1
+version:         0.2.2
 license:         BSD3
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
