diff -Nru haskell-xmlhtml-0.2.1/debian/changelog haskell-xmlhtml-0.2.3/debian/changelog
--- haskell-xmlhtml-0.2.1/debian/changelog 2013-10-26 06:49:21.000000000 +0000
+++ haskell-xmlhtml-0.2.3/debian/changelog 2013-12-19 01:53:21.000000000 +0000
@@ -1,8 +1,24 @@
-haskell-xmlhtml (0.2.1-1build1) trusty; urgency=low
+haskell-xmlhtml (0.2.3-1build2) trusty; urgency=medium
* Rebuild for new GHC ABIs.
- -- Colin Watson Sat, 26 Oct 2013 07:49:21 +0100
+ -- Colin Watson Thu, 19 Dec 2013 01:53:21 +0000
+
+haskell-xmlhtml (0.2.3-1build1) trusty; urgency=low
+
+ * Rebuild for new GHC ABIs.
+
+ -- Colin Watson Sat, 14 Dec 2013 04:32:19 +0000
+
+haskell-xmlhtml (0.2.3-1) unstable; urgency=low
+
+ [ Joachim Breitner ]
+ * Adjust watch file to new hackage layout
+
+ [ Clint Adams ]
+ * New upstream version.
+
+ -- Clint Adams Fri, 22 Nov 2013 22:39:37 -0500
haskell-xmlhtml (0.2.1-1) unstable; urgency=low
diff -Nru haskell-xmlhtml-0.2.1/debian/control haskell-xmlhtml-0.2.3/debian/control
--- haskell-xmlhtml-0.2.1/debian/control 2013-08-10 00:22:40.000000000 +0000
+++ haskell-xmlhtml-0.2.3/debian/control 2013-11-23 03:40:23.000000000 +0000
@@ -33,7 +33,7 @@
, libghc-parsec3-doc
, libghc-text-doc
, libghc-unordered-containers-doc
-Standards-Version: 3.9.4
+Standards-Version: 3.9.5
Homepage: http://hackage.haskell.org/package/xmlhtml
Vcs-Darcs: http://darcs.debian.org/pkg-haskell/haskell-xmlhtml
Vcs-Browser: http://darcs.debian.org/cgi-bin/darcsweb.cgi?r=pkg-haskell/haskell-xmlhtml
diff -Nru haskell-xmlhtml-0.2.1/debian/watch haskell-xmlhtml-0.2.3/debian/watch
--- haskell-xmlhtml-0.2.1/debian/watch 2013-08-10 00:08:12.000000000 +0000
+++ haskell-xmlhtml-0.2.3/debian/watch 2013-11-23 03:39:23.000000000 +0000
@@ -1,5 +1,2 @@
version=3
-opts="downloadurlmangle=s|archive/([\w\d_-]+)/([\d\.]+)/|archive/$1/$2/$1-$2.tar.gz|,\
-filenamemangle=s|(.*)/$|xmlhtml-$1.tar.gz|" \
- http://hackage.haskell.org/packages/archive/xmlhtml \
- ([\d\.]*\d)/
+http://hackage.haskell.org/package/xmlhtml/distro-monitor .*-([0-9\.]+).(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
diff -Nru haskell-xmlhtml-0.2.1/src/Text/XmlHtml/HTML/Meta.hs haskell-xmlhtml-0.2.3/src/Text/XmlHtml/HTML/Meta.hs
--- haskell-xmlhtml-0.2.1/src/Text/XmlHtml/HTML/Meta.hs 2013-02-21 17:07:34.000000000 +0000
+++ haskell-xmlhtml-0.2.3/src/Text/XmlHtml/HTML/Meta.hs 2013-08-26 18:56:00.000000000 +0000
@@ -4,6 +4,7 @@
module Text.XmlHtml.HTML.Meta
( voidTags
, rawTextTags
+ , isRawText
, endOmittableLast
, endOmittableNext
, predefinedRefs
@@ -30,14 +31,38 @@
]
------------------------------------------------------------------------------
--- | Elements that XmlHtml treats as raw text. Raw text elements are not
--- allowed to have any other tags in them. This is necessary to support the
--- Javascript less than operator inside a script tag, for example.
+-- | Elements that XmlHtml treats as raw text by default. Raw text elements
+-- are not allowed to have any other tags in them. This is necessary to
+-- support the Javascript less than operator inside a script tag, for example.
+--
+-- The library uses the 'isRawText' function everywhere instead of checking
+-- this set directly because that gives us an escape hatch to avoid the
+-- default behavior if necessary.
{-# NOINLINE rawTextTags #-}
rawTextTags :: HashSet Text
rawTextTags = S.fromList [ "script", "style" ]
------------------------------------------------------------------------------
+-- | Determine whether a tag should be treated as raw text. Raw text elements
+-- are not allowed to have any other tags in them. This is necessary to
+-- support the Javascript less than operator inside a script tag, for example.
+--
+-- If a tag is in the 'rawTextTags' set, this function allows you to override
+-- that behavior by adding the @xmlhtmlNotRaw@ attribute. Conversely, if a
+-- tag is not in the 'rawTextTags' set, this function allows you to override
+-- that by adding the @xmlhtmlRaw@ attribute to the tag.
+--
+-- This is the function that is actually used in the parser and renderer.
+-- 'rawTextTags' is not used any more, but is still provided for backwards
+-- compatibility and to let you see which tags are treated as raw by default.
+{-# NOINLINE isRawText #-}
+isRawText :: Text -> [(Text, Text)] -> Bool
+isRawText tag as =
+ if tag `S.member` rawTextTags
+ then ("xmlhtmlNotRaw", "") `notElem` as
+ else ("xmlhtmlRaw", "") `elem` as
+
+------------------------------------------------------------------------------
-- | List of elements with omittable end tags.
{-# NOINLINE endOmittableLast #-}
endOmittableLast :: HashSet Text
diff -Nru haskell-xmlhtml-0.2.1/src/Text/XmlHtml/HTML/Parse.hs haskell-xmlhtml-0.2.3/src/Text/XmlHtml/HTML/Parse.hs
--- haskell-xmlhtml-0.2.1/src/Text/XmlHtml/HTML/Parse.hs 2013-02-21 17:07:34.000000000 +0000
+++ haskell-xmlhtml-0.2.3/src/Text/XmlHtml/HTML/Parse.hs 2013-08-26 18:56:00.000000000 +0000
@@ -158,7 +158,7 @@
else nonEmptyElem
where
nonEmptyElem
- | tbase `S.member` rawTextTags = do
+ | isRawText tbase a = do
c <- XML.cdata "<" $ P.try (endTag t)
return (Element t a [c], Matched)
| tbase `S.member` endOmittableLast = tagContents optional
diff -Nru haskell-xmlhtml-0.2.1/src/Text/XmlHtml/HTML/Render.hs haskell-xmlhtml-0.2.3/src/Text/XmlHtml/HTML/Render.hs
--- haskell-xmlhtml-0.2.1/src/Text/XmlHtml/HTML/Render.hs 2013-02-21 17:07:34.000000000 +0000
+++ haskell-xmlhtml-0.2.3/src/Text/XmlHtml/HTML/Render.hs 2013-08-26 18:56:00.000000000 +0000
@@ -98,7 +98,7 @@
`mappend` fromText e " />"
| tb `S.member` voidTags =
error $ T.unpack t ++ " must be empty"
- | tb `S.member` rawTextTags,
+ | isRawText tb a,
all isTextNode c,
let s = T.concat (map nodeText c),
not ("" `T.append` t `T.isInfixOf` s) =
@@ -110,10 +110,10 @@
`mappend` fromText e ""
`mappend` fromText e t
`mappend` fromText e ">"
- | tb `S.member` rawTextTags,
+ | isRawText tb a,
[ TextNode _ ] <- c =
error $ T.unpack t ++ " cannot contain text looking like its end tag"
- | tb `S.member` rawTextTags =
+ | isRawText tb a =
error $ T.unpack t ++ " cannot contain child elements or comments"
| otherwise =
fromText e "<"
diff -Nru haskell-xmlhtml-0.2.1/src/Text/XmlHtml.hs haskell-xmlhtml-0.2.3/src/Text/XmlHtml.hs
--- haskell-xmlhtml-0.2.1/src/Text/XmlHtml.hs 2013-02-21 17:07:34.000000000 +0000
+++ haskell-xmlhtml-0.2.3/src/Text/XmlHtml.hs 2013-08-26 18:56:00.000000000 +0000
@@ -57,8 +57,9 @@
-- * Rendering
render,
- XML.renderXmlFragment,
- HTML.renderHtmlFragment
+ XMLR.renderXmlFragment,
+ HTML.renderHtmlFragment,
+ renderDocType
) where
------------------------------------------------------------------------------
@@ -69,7 +70,7 @@
import Text.XmlHtml.TextParser
import qualified Text.XmlHtml.XML.Parse as XML
-import qualified Text.XmlHtml.XML.Render as XML
+import qualified Text.XmlHtml.XML.Render as XMLR
import qualified Text.XmlHtml.HTML.Parse as HTML
import qualified Text.XmlHtml.HTML.Render as HTML
@@ -101,6 +102,10 @@
------------------------------------------------------------------------------
-- | Renders a 'Document'.
render :: Document -> Builder
-render (XmlDocument e dt ns) = XML.render e dt ns
+render (XmlDocument e dt ns) = XMLR.render e dt ns
render (HtmlDocument e dt ns) = HTML.render e dt ns
+
+renderDocType :: Encoding -> Maybe DocType -> Builder
+renderDocType = XMLR.docTypeDecl
+
diff -Nru haskell-xmlhtml-0.2.1/test/suite/Text/XmlHtml/Tests.hs haskell-xmlhtml-0.2.3/test/suite/Text/XmlHtml/Tests.hs
--- haskell-xmlhtml-0.2.1/test/suite/Text/XmlHtml/Tests.hs 2013-02-21 17:07:34.000000000 +0000
+++ haskell-xmlhtml-0.2.3/test/suite/Text/XmlHtml/Tests.hs 2013-08-26 18:56:00.000000000 +0000
@@ -64,7 +64,7 @@
testIt "emptyElement " emptyElement,
testIt "emptyElement2 " emptyElement2,
testIt "elemWithText " elemWithText,
- testIt "xmlDecl " xmlDecl,
+ testIt "xmlDeclXML " xmlDeclXML,
testIt "procInst " procInst,
testIt "badDoctype1 " badDoctype1,
testIt "badDoctype2 " badDoctype2,
@@ -181,8 +181,8 @@
elemWithText = parseXML "" "text"
== Right (XmlDocument UTF8 Nothing [Element "myElement" [] [TextNode "text"]])
-xmlDecl :: Bool
-xmlDecl = parseXML "" ""
+xmlDeclXML :: Bool
+xmlDeclXML = parseXML "" ""
== Right (XmlDocument UTF8 Nothing [])
procInst :: Bool
@@ -408,8 +408,8 @@
== Right (HtmlDocument UTF8 Nothing [Element "img" [] []])
rawTextElem :: Bool
-rawTextElem = parseHTML "" ""
- == Right (HtmlDocument UTF8 Nothing [Element "script" [] [
+rawTextElem = parseHTML "" ""
+ == Right (HtmlDocument UTF8 Nothing [Element "script" [("type", "text/javascript")] [
TextNode "Thistest&"]
])
diff -Nru haskell-xmlhtml-0.2.1/test/xmlhtml-testsuite.cabal haskell-xmlhtml-0.2.3/test/xmlhtml-testsuite.cabal
--- haskell-xmlhtml-0.2.1/test/xmlhtml-testsuite.cabal 2013-02-21 17:07:34.000000000 +0000
+++ haskell-xmlhtml-0.2.3/test/xmlhtml-testsuite.cabal 2013-08-26 18:56:00.000000000 +0000
@@ -9,14 +9,14 @@
build-depends:
HUnit == 1.2.*,
- directory >= 1.0 && <1.2,
+ directory >= 1.0 && <1.3,
QuickCheck >= 2.3.0.2,
base == 4.*,
blaze-builder >= 0.2 && <0.4,
- blaze-html >= 0.5 && <0.6,
+ blaze-html >= 0.5 && <0.7,
blaze-markup >= 0.5 && <0.6,
- bytestring == 0.9.*,
- containers >= 0.3 && <0.5,
+ bytestring >= 0.9 && <0.11,
+ containers >= 0.3 && <0.6,
parsec >= 3.1.2 && <3.2,
test-framework >= 0.6 && <0.7,
test-framework-hunit >= 0.2.7 && <0.3,
@@ -24,5 +24,5 @@
text >= 0.11 && <0.12,
unordered-containers >= 0.1.4 && <0.3
- ghc-options: -O2 -Wall -fhpc -fwarn-tabs -funbox-strict-fields -threaded
+ ghc-options: -Wall -fhpc -fwarn-tabs -funbox-strict-fields -threaded
-fno-warn-unused-do-bind
diff -Nru haskell-xmlhtml-0.2.1/xmlhtml.cabal haskell-xmlhtml-0.2.3/xmlhtml.cabal
--- haskell-xmlhtml-0.2.1/xmlhtml.cabal 2013-02-21 17:07:36.000000000 +0000
+++ haskell-xmlhtml-0.2.3/xmlhtml.cabal 2013-08-26 18:56:01.000000000 +0000
@@ -1,5 +1,5 @@
Name: xmlhtml
-Version: 0.2.1
+Version: 0.2.3
Synopsis: XML parser and renderer with HTML 5 quirks mode
Description: Contains renderers and parsers for both XML and HTML 5
document fragments, which share data structures so that