diff --git a/.gitignore b/.gitignore
new file mode 100644
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,1 @@
+.project
diff --git a/Text/XHtml.hs b/Text/XHtml.hs
--- a/Text/XHtml.hs
+++ b/Text/XHtml.hs
@@ -1,3 +1,7 @@
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Text.XHtml
@@ -6,8 +10,8 @@
 --                (c) Bjorn Bringert, 2004-2006
 -- License     :  BSD-style (see the file LICENSE)
 -- Maintainer  :  Chris Dornan <chris@chrisdornan.com>
--- Stability   :  stable
--- Portability :  portable
+-- Stability   :  Stable
+-- Portability :  Portable
 --
 -- An XHTML combinator library.
 --
diff --git a/Text/XHtml/BlockTable.hs b/Text/XHtml/BlockTable.hs
--- a/Text/XHtml/BlockTable.hs
+++ b/Text/XHtml/BlockTable.hs
@@ -1,4 +1,6 @@
--- #hide
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
 
 -----------------------------------------------------------------------------
 -- |
@@ -7,8 +9,8 @@
 --                    Science and Technology, 1999-2001
 -- License     :  BSD-style (see the file LICENSE)
 -- Maintainer  :  Chris Dornan <chris@chrisdornan.com>
--- Stability   :  stable
--- Portability :  portable
+-- Stability   :  Stable
+-- Portability :  Portable
 --
 -- An XHTML combinator library
 --
diff --git a/Text/XHtml/Debug.hs b/Text/XHtml/Debug.hs
--- a/Text/XHtml/Debug.hs
+++ b/Text/XHtml/Debug.hs
@@ -1,3 +1,9 @@
+{-# OPTIONS_HADDOCK hide #-}
+-- #hide
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
+
 -- | This module contains functions for displaying
 --   HTML as a pretty tree.
 module Text.XHtml.Debug ( HtmlTree(..), treeHtml, treeColors, debugHtml ) where
diff --git a/Text/XHtml/Extras.hs b/Text/XHtml/Extras.hs
--- a/Text/XHtml/Extras.hs
+++ b/Text/XHtml/Extras.hs
@@ -1,4 +1,6 @@
--- #hide
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
 
 module Text.XHtml.Extras where
 
diff --git a/Text/XHtml/Frameset.hs b/Text/XHtml/Frameset.hs
--- a/Text/XHtml/Frameset.hs
+++ b/Text/XHtml/Frameset.hs
@@ -1,3 +1,7 @@
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
+
 -- | Produces XHTML 1.0 Frameset.
 module Text.XHtml.Frameset (
      -- * Data types
diff --git a/Text/XHtml/Frameset/Attributes.hs b/Text/XHtml/Frameset/Attributes.hs
--- a/Text/XHtml/Frameset/Attributes.hs
+++ b/Text/XHtml/Frameset/Attributes.hs
@@ -1,4 +1,8 @@
+{-# OPTIONS_HADDOCK hide #-}
 -- #hide
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
 
 module Text.XHtml.Frameset.Attributes where
 
diff --git a/Text/XHtml/Frameset/Elements.hs b/Text/XHtml/Frameset/Elements.hs
--- a/Text/XHtml/Frameset/Elements.hs
+++ b/Text/XHtml/Frameset/Elements.hs
@@ -1,4 +1,8 @@
+{-# OPTIONS_HADDOCK hide #-}
 -- #hide
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
 
 module Text.XHtml.Frameset.Elements where
 
diff --git a/Text/XHtml/Internals.hs b/Text/XHtml/Internals.hs
--- a/Text/XHtml/Internals.hs
+++ b/Text/XHtml/Internals.hs
@@ -1,4 +1,8 @@
+{-# OPTIONS_HADDOCK hide #-}
 -- #hide
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
 
 -----------------------------------------------------------------------------
 -- |
@@ -8,8 +12,8 @@
 --                (c) Bjorn Bringert, 2004-2006
 -- License     :  BSD-style (see the file LICENSE)
 -- Maintainer  :  Chris Dornan <chris@chrisdornan.com>
--- Stability   :  stable
--- Portability :  portable
+-- Stability   :  Stable
+-- Portability :  Portable
 --
 -- Internals of the XHTML combinator library.
 -----------------------------------------------------------------------------
diff --git a/Text/XHtml/Strict.hs b/Text/XHtml/Strict.hs
--- a/Text/XHtml/Strict.hs
+++ b/Text/XHtml/Strict.hs
@@ -1,3 +1,7 @@
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
+
 -- | Produces XHTML 1.0 Strict.
 module Text.XHtml.Strict (
      -- * Data types
diff --git a/Text/XHtml/Strict/Attributes.hs b/Text/XHtml/Strict/Attributes.hs
--- a/Text/XHtml/Strict/Attributes.hs
+++ b/Text/XHtml/Strict/Attributes.hs
@@ -1,4 +1,8 @@
+{-# OPTIONS_HADDOCK hide #-}
 -- #hide
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
 
 module Text.XHtml.Strict.Attributes where
 
diff --git a/Text/XHtml/Strict/Elements.hs b/Text/XHtml/Strict/Elements.hs
--- a/Text/XHtml/Strict/Elements.hs
+++ b/Text/XHtml/Strict/Elements.hs
@@ -1,4 +1,8 @@
+{-# OPTIONS_HADDOCK hide #-}
 -- #hide
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
 
 module Text.XHtml.Strict.Elements where
 
diff --git a/Text/XHtml/Table.hs b/Text/XHtml/Table.hs
--- a/Text/XHtml/Table.hs
+++ b/Text/XHtml/Table.hs
@@ -1,3 +1,8 @@
+{-# LANGUAGE CPP #-}
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
+
 -- | Table combinators for XHTML.
 module Text.XHtml.Table (HtmlTable, HTMLTABLE(..),
                         (</>), above, (<->), beside, 
diff --git a/Text/XHtml/Transitional.hs b/Text/XHtml/Transitional.hs
--- a/Text/XHtml/Transitional.hs
+++ b/Text/XHtml/Transitional.hs
@@ -1,3 +1,7 @@
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
+
 -- | Produces XHTML 1.0 Transitional.
 module Text.XHtml.Transitional (
      -- * Data types
diff --git a/Text/XHtml/Transitional/Attributes.hs b/Text/XHtml/Transitional/Attributes.hs
--- a/Text/XHtml/Transitional/Attributes.hs
+++ b/Text/XHtml/Transitional/Attributes.hs
@@ -1,4 +1,8 @@
+{-# OPTIONS_HADDOCK hide #-}
 -- #hide
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
 
 module Text.XHtml.Transitional.Attributes where
 
diff --git a/Text/XHtml/Transitional/Elements.hs b/Text/XHtml/Transitional/Elements.hs
--- a/Text/XHtml/Transitional/Elements.hs
+++ b/Text/XHtml/Transitional/Elements.hs
@@ -1,4 +1,8 @@
+{-# OPTIONS_HADDOCK hide #-}
 -- #hide
+#if __GLASGOW_HASKELL__ >= 701
+{-# LANGUAGE Safe #-}
+#endif
 
 module Text.XHtml.Transitional.Elements where
 
diff --git a/xhtml.cabal b/xhtml.cabal
--- a/xhtml.cabal
+++ b/xhtml.cabal
@@ -1,35 +1,44 @@
-Name: xhtml
-Version: 3000.2.0.2
-Copyright: Bjorn Bringert 2004-2006, Andy Gill, and the Oregon Graduate 
-           Institute of Science and Technology, 1999-2001
-Maintainer: Chris Dornan <chris@chrisdornan.com>
-Author: Bjorn Bringert
-License: BSD3
-License-file: LICENSE
-Build-depends: base >= 4.0 && < 4.5
-Extensions: 
-Synopsis: An XHTML combinator library
-Category:        Web, XML, Pretty Printer
-Stability:       Stable
-Description:
- This package provides combinators for producing
-  XHTML 1.0, including the Strict, Transitional and Frameset variants.
-Build-Type: Simple
-Exposed-Modules: 
-  Text.XHtml, 
-  Text.XHtml.Frameset,
-  Text.XHtml.Strict,
-  Text.XHtml.Transitional,
-  Text.XHtml.Debug,
-  Text.XHtml.Table
-Other-modules:
-  Text.XHtml.Strict.Attributes,
-  Text.XHtml.Strict.Elements,
-  Text.XHtml.Frameset.Attributes,
-  Text.XHtml.Frameset.Elements,
-  Text.XHtml.Transitional.Attributes,
-  Text.XHtml.Transitional.Elements,
-  Text.XHtml.BlockTable,
-  Text.XHtml.Extras,
-  Text.XHtml.Internals
-ghc-options: -Wall
+Name:               xhtml
+Version:            3000.2.0.3
+Copyright:          Bjorn Bringert 2004-2006, Andy Gill, and the Oregon Graduate 
+                    Institute of Science and Technology, 1999-2001
+Maintainer:         Chris Dornan <chris@chrisdornan.com>
+Author:             Bjorn Bringert
+License:            BSD3
+License-file:       LICENSE
+Build-depends:      base >= 4.0 && < 4.5
+Synopsis:           An XHTML combinator library
+Description:        This package provides combinators for producing
+                    XHTML 1.0, including the Strict, Transitional and
+                    Frameset variants.
+Stability:          Stable
+Category:           Web, XML, Pretty Printer
+Homepage:           https://github.com/haskell/xhtml
+Build-type:         Simple
+Cabal-version:      >= 1.6
+
+Source-repository head
+    type:           git
+    location:       git@github.com:haskell/xhtml.git
+
+library 
+    Exposed-modules: 
+                    Text.XHtml, 
+                    Text.XHtml.Frameset,
+                    Text.XHtml.Strict,
+                    Text.XHtml.Transitional,
+                    Text.XHtml.Debug,
+                    Text.XHtml.Table
+    Other-modules:
+                    Text.XHtml.Strict.Attributes,
+                    Text.XHtml.Strict.Elements,
+                    Text.XHtml.Frameset.Attributes,
+                    Text.XHtml.Frameset.Elements,
+                    Text.XHtml.Transitional.Attributes,
+                    Text.XHtml.Transitional.Elements,
+                    Text.XHtml.BlockTable,
+                    Text.XHtml.Extras,
+                    Text.XHtml.Internals
+    
+    ghc-options:    -Wall
+    Extensions:     CPP
