~alcinnz/haskell-stylist

93288bed5abfd3bdee658892fcd734e3e9ce4a33 — Adrian Cochrane 4 years ago 186cbff
Integrate unstyled tests into XML Conduit Stylist.
M xml-conduit-stylist/src/Data/HTML2CSS.hs => xml-conduit-stylist/src/Data/HTML2CSS.hs +3 -0
@@ 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
}

M xml-conduit-stylist/xml-conduit-stylist.cabal => xml-conduit-stylist/xml-conduit-stylist.cabal +1 -1
@@ 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