diff --git a/Text/Hamlet/NonPoly.hs b/Text/Hamlet/NonPoly.hs
--- a/Text/Hamlet/NonPoly.hs
+++ b/Text/Hamlet/NonPoly.hs
@@ -136,7 +136,7 @@
             let d' = derefToExp scope d
             pet <- [|preEscapedText|]
             return $ hrFromHtml hr `AppE` (pet `AppE` (ou `AppE` d'))
-contentToExp _ hr scope (ContentEmbed d) = return $ derefToExp scope d
+contentToExp env hr scope (ContentEmbed d) = hrEmbed hr env $ derefToExp scope d
 contentToExp env hr scope (ContentMsg d) =
     case msgRender env of
         Nothing -> error "Message interpolation used, but no message renderer provided"
@@ -149,7 +149,7 @@
 htmlRules :: Q HamletRules
 htmlRules = do
     i <- [|id|]
-    return $ HamletRules i ($ (Env Nothing Nothing))
+    return $ HamletRules i ($ (Env Nothing Nothing)) (\_ b -> return b)
 
 hamlet :: QuasiQuoter
 hamlet = hamletWithSettings hamletRules defaultHamletSettings
@@ -165,7 +165,9 @@
                     }
             h <- f env
             return $ LamE [VarP r] h
-    return $ HamletRules i ur
+    let em (Env (Just urender) Nothing) e =
+            urender $ \ur -> return (e `AppE` ur)
+    return $ HamletRules i ur em
 
 ihamlet :: QuasiQuoter
 ihamlet = hamletWithSettings ihamletRules defaultHamletSettings
@@ -182,7 +184,9 @@
                     }
             h <- f env
             return $ LamE [VarP m, VarP u] h
-    return $ HamletRules i ur
+    let em (Env (Just urender) (Just mrender)) e =
+            urender $ \ur -> mrender $ \mr -> return (e `AppE` mr `AppE` ur)
+    return $ HamletRules i ur em
 
 hamletWithSettings :: Q HamletRules -> HamletSettings -> QuasiQuoter
 hamletWithSettings hr set =
@@ -193,6 +197,7 @@
 data HamletRules = HamletRules
     { hrFromHtml :: Exp
     , hrWithEnv :: (Env -> Q Exp) -> Q Exp
+    , hrEmbed :: Env -> Exp -> Q Exp
     }
 
 data Env = Env
diff --git a/Text/Hamlet/Parse.hs b/Text/Hamlet/Parse.hs
--- a/Text/Hamlet/Parse.hs
+++ b/Text/Hamlet/Parse.hs
@@ -103,9 +103,16 @@
         return $ LineContent []
     htmlComment = do
         _ <- try $ string "<!--"
-        _ <- many $ noneOf "\r\n"
+        _ <- manyTill anyChar $ try $ string "-->"
+        x <- many nonComments
         eol
-        return $ LineContent []
+        return $ LineContent [ContentRaw $ concat x] -- FIXME handle variables?
+    nonComments = (many1 $ noneOf "\r\n<") <|> (do
+        _ <- char '<'
+        (do
+            try $ string "!--"
+            _ <- manyTill anyChar $ try $ string "-->"
+            return "") <|> return "<")
     backslash = do
         _ <- char '\\'
         (eol >> return (LineContent [ContentRaw "\n"]))
diff --git a/Text/Shakespeare.hs b/Text/Shakespeare.hs
--- a/Text/Shakespeare.hs
+++ b/Text/Shakespeare.hs
@@ -4,7 +4,7 @@
 {-# LANGUAGE CPP #-}
 -- | General parsers, functions and datatypes for all three languages.
 module Text.Shakespeare
-    ( Deref
+    ( Deref (..)
     , Ident (..)
     , Scope
     , parseDeref
diff --git a/hamlet.cabal b/hamlet.cabal
--- a/hamlet.cabal
+++ b/hamlet.cabal
@@ -1,5 +1,5 @@
 name:            hamlet
-version:         0.8.1
+version:         0.8.2
 license:         BSD3
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
@@ -46,11 +46,11 @@
                      Text.Julius
                      Text.Coffee
                      Text.Romeo
+                     Text.Shakespeare
     other-modules:   Text.Hamlet.Parse
                      Text.Hamlet.Quasi
                      Text.Hamlet.Debug
                      Text.MkSizeType
-                     Text.Shakespeare
                      Text.Css
     ghc-options:     -Wall
 
