diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,7 @@
+### 2.0.12.1
+
+* New contentHash parser breaks hash hrefs [#200](https://github.com/yesodweb/shakespeare/issues/200)
+
 ### 2.0.12
 
 * Parser fails without space between class and ID (Hamlet) [#197](https://github.com/yesodweb/shakespeare/issues/197)
diff --git a/Text/Hamlet/Parse.hs b/Text/Hamlet/Parse.hs
--- a/Text/Hamlet/Parse.hs
+++ b/Text/Hamlet/Parse.hs
@@ -256,8 +256,8 @@
         x <- parseHash
         case x of
             Left "#" -> case cr of
-                          InContent -> return (ContentRaw "#", False)
-                          _ -> fail "Expected hash at end of line, got Id"
+                          NotInQuotes -> fail "Expected hash at end of line, got Id"
+                          _ -> return (ContentRaw "#", False)
             Left str -> return (ContentRaw str, null str)
             Right deref -> return (ContentVar deref, False)
     contentAt = do
diff --git a/shakespeare.cabal b/shakespeare.cabal
--- a/shakespeare.cabal
+++ b/shakespeare.cabal
@@ -1,5 +1,5 @@
 name:            shakespeare
-version:         2.0.12
+version:         2.0.12.1
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
diff --git a/test/Text/HamletSpec.hs b/test/Text/HamletSpec.hs
--- a/test/Text/HamletSpec.hs
+++ b/test/Text/HamletSpec.hs
@@ -501,6 +501,14 @@
             ] renderer
         helperHtml "foo(5,[(\"hello\",\"world\")])bar" res
 
+    it "Hash in attribute value" $
+        helper "<a id=\"logoutbutton\" href=\"#\"></a>\n"
+        [hamlet|<a #logoutbutton href=#>|]
+
+    it "Hash in attribute value" $
+        helper "<a id=\"logoutbutton\" href=\"#\"></a>\n"
+        [hamlet|<a #logoutbutton href="#">|]
+
 data Pair = Pair String Int
 
 data Url = Home | Sub SubUrl
