diff --git a/TagSoup/Test.hs b/TagSoup/Test.hs
--- a/TagSoup/Test.hs
+++ b/TagSoup/Test.hs
@@ -218,6 +218,8 @@
     (TagOpen "test" [] ~== "<test>") === True
     (TagOpen "test" [] ~== "<soup>") === False
     (TagOpen "test" [] ~/= "<soup>") === True
+    (TagComment "foo" ~== "<!--foo-->") === True
+    (TagComment "bar" ~== "<!--bar-->") === True
 
 
 warnTests :: Test ()
diff --git a/Text/HTML/TagSoup.hs b/Text/HTML/TagSoup.hs
--- a/Text/HTML/TagSoup.hs
+++ b/Text/HTML/TagSoup.hs
@@ -91,6 +91,9 @@
                 g (name,val) | strNull name = val  `elem` map snd ys
                              | strNull val  = name `elem` map fst ys
                 g nameval = nameval `elem` ys
+        f (TagComment x) (TagComment y) = strNull x || x == y
+        f (TagWarning x) (TagWarning y) = strNull x || x == y
+        f (TagPosition x1 x2) (TagPosition y1 y2) = x1 == y1 && x2 == y2
         f _ _ = False
 
 -- | Negation of '~=='
diff --git a/tagsoup.cabal b/tagsoup.cabal
--- a/tagsoup.cabal
+++ b/tagsoup.cabal
@@ -1,6 +1,6 @@
 cabal-version:  >= 1.6
 name:           tagsoup
-version:        0.12.3
+version:        0.12.4
 copyright:      Neil Mitchell 2006-2011
 author:         Neil Mitchell <ndmitchell@gmail.com>
 maintainer:     Neil Mitchell <ndmitchell@gmail.com>
