From 93288bed5abfd3bdee658892fcd734e3e9ce4a33 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Wed, 1 Apr 2020 16:31:22 +1300 Subject: [PATCH] Integrate unstyled tests into XML Conduit Stylist. --- xml-conduit-stylist/src/Data/HTML2CSS.hs | 3 +++ xml-conduit-stylist/xml-conduit-stylist.cabal | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xml-conduit-stylist/src/Data/HTML2CSS.hs b/xml-conduit-stylist/src/Data/HTML2CSS.hs index fa111f1..ecd4283 100644 --- a/xml-conduit-stylist/src/Data/HTML2CSS.hs +++ b/xml-conduit-stylist/src/Data/HTML2CSS.hs @@ -21,16 +21,19 @@ import qualified Data.CSS.Preprocessor.Conditions.Expr as Query import Network.URI ---- Constants +-- | Set the priority for a CSS stylesheet being parsed. cssPriorityAgent, cssPriorityUser, cssPriorityAuthor :: StyleSheet s => s -> s cssPriorityAgent = setPriority 1 cssPriorityUser = setPriority 2 cssPriorityAuthor = setPriority 3 ---- Parsing +-- | Converts a parsed XML or HTML file to a `ConditionalStyles` `StyleSheet`. html2css :: PropertyParser p => XML.Document -> URI -> ConditionalStyles p html2css xml url = testIsStyled $ ConditionalStyles { hostURL = url, mediaDocument = "document", + isUnstyled = False, rules = Priority 3 : html2css' (XML.documentRoot xml) (conditionalStyles url "document"), propertyParser = temp } diff --git a/xml-conduit-stylist/xml-conduit-stylist.cabal b/xml-conduit-stylist/xml-conduit-stylist.cabal index bfffc1a..c01a7a9 100644 --- a/xml-conduit-stylist/xml-conduit-stylist.cabal +++ b/xml-conduit-stylist/xml-conduit-stylist.cabal @@ -61,7 +61,7 @@ library -- Other library packages from which modules are imported. build-depends: base >=4.9 && <4.10, - stylist >=1.1.1 && <2, css-syntax, unordered-containers, + stylist >=1.2.0 && <2, css-syntax, unordered-containers, xml-conduit >=1.8 && < 1.9, text, containers, network-uri -- 2.30.2