hakyll 4.1.0.0 → 4.1.1.0
raw patch · 3 files changed
+19/−7 lines, 3 filesdep ~test-frameworkdep ~test-framework-hunitdep ~test-framework-quickcheck2PVP ok
version bump matches the API change (PVP)
Dependency ranges changed: test-framework, test-framework-hunit, test-framework-quickcheck2
API changes (from Hackage documentation)
Files
- hakyll.cabal +4/−4
- src/Hakyll/Web/Html.hs +11/−3
- tests/Hakyll/Web/Html/Tests.hs +4/−0
hakyll.cabal view
@@ -1,5 +1,5 @@ Name: hakyll-Version: 4.1.0.0+Version: 4.1.1.0 Synopsis: A static website compiler library Description:@@ -176,9 +176,9 @@ Build-Depends: HUnit >= 1.2 && < 1.3, QuickCheck >= 2.4 && < 2.6,- test-framework >= 0.4 && < 0.7,- test-framework-hunit >= 0.2 && < 0.3,- test-framework-quickcheck2 >= 0.2 && < 0.3,+ test-framework >= 0.4 && < 0.9,+ test-framework-hunit >= 0.2 && < 0.4,+ test-framework-quickcheck2 >= 0.2 && < 0.4, -- Copy pasted from hakyll dependencies: base >= 4 && < 5, binary >= 0.5 && < 0.7,
src/Hakyll/Web/Html.hs view
@@ -24,6 +24,7 @@ import Data.Char (digitToInt, intToDigit, isDigit, toLower) import Data.List (isPrefixOf)+import qualified Data.Set as S import System.FilePath (joinPath, splitPath, takeDirectory) import Text.Blaze.Html (toHtml)@@ -71,13 +72,20 @@ attr (k, v) = (k, if isUrlAttribute k then f v else v) --- | Customized TagSoup renderer. (The default TagSoup renderer escape CSS--- within style tags.)+--------------------------------------------------------------------------------+-- | Customized TagSoup renderer. The default TagSoup renderer escape CSS+-- within style tags, and doesn't properly minimize. renderTags' :: [TS.Tag String] -> String renderTags' = TS.renderTagsOptions TS.renderOptions { TS.optRawTag = (`elem` ["script", "style"]) . map toLower- , TS.optMinimize = (`elem` ["br", "img"])+ , TS.optMinimize = (`S.member` minimize) . map toLower }+ where+ -- A list of elements which must be minimized+ minimize = S.fromList+ [ "area", "br", "col", "embed", "hr", "img", "input", "meta", "link"+ , "param"+ ] --------------------------------------------------------------------------------
tests/Hakyll/Web/Html/Tests.hs view
@@ -36,6 +36,10 @@ withUrls id "<code><stdio></code>" , "<style>body > p { line-height: 1.3 }</style>" @=? withUrls id "<style>body > p { line-height: 1.3 }</style>"++ -- Test minimizing elements+ , "<meta bar=\"foo\" />" @=?+ withUrls id "<meta bar=\"foo\" />" ] , fromAssertions "toUrl"