Hello community,
here is the log from the commit of package microformats2-parser for
openSUSE:Factory checked in at 2017-06-12 15:28:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/microformats2-parser (Old)
and /work/SRC/openSUSE:Factory/.microformats2-parser.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "microformats2-parser"
Mon Jun 12 15:28:33 2017 rev:2 rq:499749 version:1.0.1.7
Changes:
--------
---
/work/SRC/openSUSE:Factory/microformats2-parser/microformats2-parser.changes
2017-05-10 20:53:02.641456425 +0200
+++
/work/SRC/openSUSE:Factory/.microformats2-parser.new/microformats2-parser.changes
2017-06-12 15:28:36.924654694 +0200
@@ -1,0 +2,5 @@
+Thu May 18 09:52:23 UTC 2017 - [email protected]
+
+- Update to version 1.0.1.7 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
microformats2-parser-1.0.1.6.tar.gz
New:
----
microformats2-parser-1.0.1.7.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ microformats2-parser.spec ++++++
--- /var/tmp/diff_new_pack.o6HwLf/_old 2017-06-12 15:28:37.564564447 +0200
+++ /var/tmp/diff_new_pack.o6HwLf/_new 2017-06-12 15:28:37.564564447 +0200
@@ -19,7 +19,7 @@
%global pkg_name microformats2-parser
%bcond_with tests
Name: %{pkg_name}
-Version: 1.0.1.6
+Version: 1.0.1.7
Release: 0
Summary: A Microformats 2 parser
License: SUSE-Public-Domain
@@ -49,15 +49,14 @@
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-safe-devel
BuildRequires: ghc-scotty-devel
-BuildRequires: ghc-streaming-commons-devel
BuildRequires: ghc-tagsoup-devel
BuildRequires: ghc-text-devel
BuildRequires: ghc-time-devel
BuildRequires: ghc-transformers-devel
BuildRequires: ghc-unordered-containers-devel
BuildRequires: ghc-vector-devel
+BuildRequires: ghc-wai-cli-devel
BuildRequires: ghc-wai-extra-devel
-BuildRequires: ghc-warp-devel
BuildRequires: ghc-xml-lens-devel
BuildRequires: ghc-xss-sanitize-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ microformats2-parser-1.0.1.6.tar.gz ->
microformats2-parser-1.0.1.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/microformats2-parser-1.0.1.6/README.md
new/microformats2-parser-1.0.1.7/README.md
--- old/microformats2-parser-1.0.1.6/README.md 2016-03-14 22:32:54.000000000
+0100
+++ new/microformats2-parser-1.0.1.7/README.md 2017-05-14 23:07:57.000000000
+0200
@@ -64,9 +64,8 @@
## Contributing
Please feel free to submit pull requests!
-Bugfixes and simple non-breaking improvements will be accepted without any
questions :-)
-By participating in this project you agree to follow the [Contributor Code of
Conduct](http://contributor-covenant.org/version/1/2/0/).
+By participating in this project you agree to follow the [Contributor Code of
Conduct](http://contributor-covenant.org/version/1/4/) and to release your
contributions under the Unlicense.
[The list of contributors is available on
GitHub](https://github.com/myfreeweb/microformats2-parser/graphs/contributors).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/microformats2-parser-1.0.1.6/executable/Main.hs
new/microformats2-parser-1.0.1.7/executable/Main.hs
--- old/microformats2-parser-1.0.1.6/executable/Main.hs 2016-09-18
13:17:47.000000000 +0200
+++ new/microformats2-parser-1.0.1.7/executable/Main.hs 2017-01-23
21:59:32.000000000 +0100
@@ -1,41 +1,23 @@
-{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
+{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-unused-do-bind #-}
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings, UnicodeSyntax #-}
module Main (main) where
import Prelude.Compat
-import Control.Exception
import Data.Microformats2.Parser
-import Data.List
-import Data.Maybe (fromMaybe)
import Data.Aeson.Encode.Pretty
import Data.Aeson.Types (object)
import Data.Default
import qualified Data.Text.Lazy as TL
-import Data.Streaming.Network (bindPath)
-import Network.Wai.Handler.Warp
-import qualified Network.Wai.Handler.CGI as CGI
+import Network.Wai.Cli
import Network.Wai.Middleware.Autohead
-import qualified Network.Socket as S
import Network.URI (parseURI)
import Web.Scotty hiding (html)
import Text.Blaze.Html5 as H hiding (main, param, object, base)
import Text.Blaze.Html5.Attributes as A
import Text.Blaze.Html.Renderer.Utf8 (renderHtml)
-import qualified Options as O
-data AppOptions = AppOptions
- { port ∷ Int
- , socket ∷ String
- , protocol ∷ String }
-
-instance O.Options AppOptions where
- defineOptions = pure AppOptions
- <*> O.simpleOption "port" 3000
"The port the app should listen for connections on (for http protocol)"
- <*> O.simpleOption "socket" "/var/run/mf2/mf2.sock"
"The UNIX domain socket the app should listen for connections on (for unix
protocol)"
- <*> O.simpleOption "protocol" "http"
"The protocol for the server. One of: http, unix, cgi"
-
exampleValue = "<body> <p class='h-adr'> <span class='p-street-address'>17
Austerstræti</span> <span class='p-locality'>Reykjavík</span> <span
class='p-country-name'>Iceland</span> <span class='p-postal-code'>107</span>
</p> <div class='h-card'> <a class='p-name u-url'
href='http://blog.lizardwrangler.com/' >Mitchell Baker</a> (<a
class='p-org h-card' href='http://mozilla.org/' >Mozilla
Foundation</a>) </div> <article class='h-entry'> <h1
class='p-name'>Microformats are amazing</h1> <p>Published by <a
class='p-author h-card' href='http://example.com'>W. Developer</a> on
<time class='dt-published' datetime='2013-06-13 12:00:00'>13<sup>th</sup> June
2013</time> <p class='p-summary'>In which I extoll the virtues of using
microformats.</p> <div class='e-content'> <p>Blah blah blah</p>
</div> </article> <span class='h-cite'> <time
class='dt-published'>YYYY-MM-DD</time> <span class='p-author
h-card'>AUTHOR</span>: <cite><a class='u-url p-name'
href='URL'>TITLE</a></cite> </span> </body>"
homePage ∷ TL.Text → Html
@@ -89,10 +71,4 @@
let root = documentRoot $ parseLBS hsrc
raw $ encodePretty $ parseMf2 (def { baseUri = parseURI base }) root
-main = O.runCommand $ \opts args → do
- let warpSettings = setPort (port opts) defaultSettings
- case protocol opts of
- "http" → app >>= runSettings warpSettings
- "unix" → bracket (bindPath $ socket opts) S.close (\s → app >>=
runSettingsSocket warpSettings s)
- "cgi" → app >>= CGI.run
- _ → putStrLn $ "Unsupported protocol: " ++ protocol opts
+main = defWaiMain =<< app
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/microformats2-parser-1.0.1.6/library/Data/Microformats2/Parser/HtmlUtil.hs
new/microformats2-parser-1.0.1.7/library/Data/Microformats2/Parser/HtmlUtil.hs
---
old/microformats2-parser-1.0.1.6/library/Data/Microformats2/Parser/HtmlUtil.hs
2016-09-18 13:56:35.000000000 +0200
+++
new/microformats2-parser-1.0.1.7/library/Data/Microformats2/Parser/HtmlUtil.hs
2017-05-14 23:04:34.000000000 +0200
@@ -55,7 +55,7 @@
getInnerHtmlSanitized b rootEl = Just $ renderInner processedRoot
where (NodeElement processedRoot) = processNode (NodeElement rootEl)
processNode (NodeContent c) = NodeContent c
- processNode (NodeElement e) = NodeElement $ processChildren
processNode $ filterChildElements (safeTagName . nameLocalName . elementName) $
resolveHrefSrc b $ sanitizeAttrs e
+ processNode (NodeElement e) = NodeElement $ processChildren
processNode $ filterChildElements (safeTagName' . nameLocalName . elementName)
$ resolveHrefSrc b $ sanitizeAttrs e
processNode x = x
getInnerTextRaw ∷ Element → Maybe Text
@@ -63,7 +63,7 @@
where txt = Just $ T.dropAround isSpace processedRoot
(NodeContent processedRoot) = processNode (NodeElement rootEl)
processNode (NodeContent c) = NodeContent $ escapeHtml c
- processNode (NodeElement e) = NodeContent $ T.dropAround isSpace $
renderInner $ processChildren processNode $ filterChildElements (safeTagName .
nameLocalName . elementName) e
+ processNode (NodeElement e) = NodeContent $ T.dropAround isSpace $
renderInner $ processChildren processNode $ filterChildElements (safeTagName' .
nameLocalName . elementName) e
processNode x = x
getInnerTextWithImgs ∷ Element → Maybe Text
@@ -72,7 +72,7 @@
(NodeContent processedRoot) = processNode (NodeElement rootEl)
processNode (NodeContent c) = NodeContent $ escapeHtml c
processNode (NodeElement e) | nameLocalName (elementName e) == "img" =
NodeContent $ fromMaybe "" $ asum [ e ^. attribute "alt", e ^. attribute "src" ]
- processNode (NodeElement e) = NodeContent $ T.dropAround isSpace $
renderInner $ processChildren processNode $ filterChildElements (safeTagName .
nameLocalName . elementName) e
+ processNode (NodeElement e) = NodeContent $ T.dropAround isSpace $
renderInner $ processChildren processNode $ filterChildElements (safeTagName' .
nameLocalName . elementName) e
processNode x = x
data HtmlContentMode = Unsafe | Escape | Sanitize
@@ -99,3 +99,6 @@
ent ← takeWhile1 (/= ';')
_ ← char ';'
return $ fromMaybe ("&" <> ent <> ";") $ T.pack <$> lookupEntity
(T.unpack ent)
+
+safeTagName' ∷ Text → Bool
+safeTagName' x = safeTagName x || "-" `T.isInfixOf` x
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/microformats2-parser-1.0.1.6/microformats2-parser.cabal
new/microformats2-parser-1.0.1.7/microformats2-parser.cabal
--- old/microformats2-parser-1.0.1.6/microformats2-parser.cabal 2016-09-18
13:58:46.000000000 +0200
+++ new/microformats2-parser-1.0.1.7/microformats2-parser.cabal 2017-05-14
23:09:10.000000000 +0200
@@ -1,11 +1,11 @@
name: microformats2-parser
-version: 1.0.1.6
+version: 1.0.1.7
synopsis: A Microformats 2 parser.
description: A parser for Microformats 2
(http://microformats.org/wiki/microformats2), a simple way to describe
structured information in HTML.
category: Web
homepage: https://github.com/myfreeweb/microformats2-parser
author: Greg V
-copyright: 2015-2016 Greg V <[email protected]>
+copyright: 2015-2017 Greg V <[email protected]>
maintainer: [email protected]
license: PublicDomain
license-file: UNLICENSE
@@ -14,7 +14,7 @@
extra-source-files:
README.md
tested-with:
- GHC == 8.0.1
+ GHC == 8.0.2
source-repository head
type: git
@@ -63,11 +63,10 @@
base >= 4.7.0.0 && < 5
, base-compat >= 0.8.0
, options
- , warp
+ , wai-cli
, wai-extra
, network
, network-uri
- , streaming-commons
, data-default
, text
, scotty
@@ -77,7 +76,7 @@
, blaze-markup
, microformats2-parser
default-language: Haskell2010
- ghc-options: -threaded -rtsopts -with-rtsopts=-N
+ ghc-options: -Wall -threaded -rtsopts "-with-rtsopts=-N -qa -qm"
hs-source-dirs: executable
main-is: Main.hs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/microformats2-parser-1.0.1.6/test-suite/Data/Microformats2/Parser/HtmlUtilSpec.hs
new/microformats2-parser-1.0.1.7/test-suite/Data/Microformats2/Parser/HtmlUtilSpec.hs
---
old/microformats2-parser-1.0.1.6/test-suite/Data/Microformats2/Parser/HtmlUtilSpec.hs
2016-03-18 10:22:20.000000000 +0100
+++
new/microformats2-parser-1.0.1.7/test-suite/Data/Microformats2/Parser/HtmlUtilSpec.hs
2017-05-14 23:04:50.000000000 +0200
@@ -20,3 +20,9 @@
let txtraw = getInnerTextWithImgs . documentRoot . parseLBS
txtraw [xml|<div>This is <a href="">text content</a> <img src="/yo"
alt="with an alt"> <img src="and-src">.
</div>|] `shouldBe` Just "This is text content with an alt and-src."
+
+ describe "getInnerHtmlSanitized" $ do
+ it "doesn't eat custom properties but eats scripts" $ do
+ let geth = getInnerHtmlSanitized Nothing . documentRoot . parseLBS
+ geth [xml|<html><custom-element
onload="alert(2)">memes<script>alert(1)</script></custom-element>|]
+ `shouldBe` Just "<custom-element>memes</custom-element>"