Hello community,
here is the log from the commit of package python-html5-parser for
openSUSE:Leap:15.2 checked in at 2020-04-14 14:22:31
Comparing /work/SRC/openSUSE:Leap:15.2/python-html5-parser (Old)
and /work/SRC/openSUSE:Leap:15.2/.python-html5-parser.new.3248 (New)
Package is "python-html5-parser"
Tue Apr 14 14:22:31 2020 rev:13 rq:793653 version:0.4.9
Changes:
---
/work/SRC/openSUSE:Leap:15.2/python-html5-parser/python-html5-parser.changes
2020-03-09 18:06:18.376845535 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.python-html5-parser.new.3248/python-html5-parser.changes
2020-04-14 14:24:15.945421581 +0200
@@ -1,0 +2,7 @@
+Thu Apr 9 11:12:17 UTC 2020 - Marketa Calabkova
+
+- Update to 0.4.9
+ * Fix an error parsing XHTML where the xlink namespace is defined on
+the root node but not on a node where the default namespace is redefined
+
+---
Old:
python-html5-parser-0.4.8.tar.gz
New:
python-html5-parser-0.4.9.tar.gz
Other differences:
--
++ python-html5-parser.spec ++
--- /var/tmp/diff_new_pack.nrNgBb/_old 2020-04-14 14:24:16.213421782 +0200
+++ /var/tmp/diff_new_pack.nrNgBb/_new 2020-04-14 14:24:16.213421782 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-html5-parser
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-html5-parser
-Version:0.4.8
+Version:0.4.9
Release:0
Summary:C based HTML 5 parsing for Python
License:Apache-2.0
@@ -48,6 +48,9 @@
%install
%python_install
+%check
+%python_exec setup.py test
+
%files %{python_files}
%license LICENSE
%doc README.rst
++ python-html5-parser-0.4.8.tar.gz -> python-html5-parser-0.4.9.tar.gz
++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/html5-parser-0.4.8/src/as-libxml.c
new/html5-parser-0.4.9/src/as-libxml.c
--- old/html5-parser-0.4.8/src/as-libxml.c 2019-07-25 08:02:44.0
+0200
+++ new/html5-parser-0.4.9/src/as-libxml.c 2019-11-03 04:13:38.0
+0100
@@ -50,14 +50,25 @@
static inline xmlNsPtr
ensure_xml_ns(xmlDocPtr doc, ParseData *pd, xmlNodePtr node) {
// By default libxml2 docs do not have the xml: namespace defined.
-xmlNodePtr root = pd->root ? pd->root : node;
if (UNLIKELY(!pd->xml)) {
+xmlNodePtr root = pd->root ? pd->root : node;
pd->xml = xmlSearchNs(doc, root, BAD_CAST "xml");
}
return pd->xml;
}
static inline xmlNsPtr
+ensure_xlink_ns(xmlDocPtr doc, ParseData *pd, xmlNodePtr node) {
+if (UNLIKELY(!pd->xlink)) {
+xmlNodePtr root = pd->root ? pd->root : node;
+pd->xlink = xmlSearchNs(doc, root, BAD_CAST "xlink");
+if (UNLIKELY(!pd->xlink)) pd->xlink = xmlNewNs(root, BAD_CAST
"http://www.w3.org/1999/xlink;, BAD_CAST "xlink");
+}
+return pd->xlink;
+}
+
+
+static inline xmlNsPtr
find_namespace_by_prefix(xmlDocPtr doc, xmlNodePtr node, xmlNodePtr
xml_parent, const char* prefix) {
xmlNsPtr ans = xmlSearchNs(doc, node, BAD_CAST prefix);
if (ans) return ans;
@@ -75,7 +86,6 @@
char buf[50] = {0};
ParseData *pd = (ParseData*)doc->_private;
xmlNsPtr ns;
-xmlNodePtr root;
int added_lang = 0;
for (unsigned int i = 0; i < elem->attributes.length; ++i) {
@@ -85,12 +95,8 @@
ns = NULL;
switch (attr->attr_namespace) {
case GUMBO_ATTR_NAMESPACE_XLINK:
-root = pd->root ? pd->root : node;
-if (UNLIKELY(!pd->xlink)) {
-pd->xlink = xmlNewNs(root, BAD_CAST
"http://www.w3.org/1999/xlink;, BAD_CAST "xlink");
-if(UNLIKELY(!pd->xlink)) return false;
-}
-ns = pd->xlink;
+ns = ensure_xlink_ns(doc, pd, node);
+if (UNLIKELY(!ns)) return false;
break;
case GUMBO_ATTR_NAMESPACE_XML:
ns = ensure_xml_ns(doc, pd, node);
@@ -105,11 +111,7 @@
break;
case GUMBO_ATTR_NAMESPACE_XMLNS:
if (strncmp(aname, "xlink", 5) == 0) {
-root = pd->root ? pd->root : node;
-if (UNLIKELY(!pd->xlink)) {
-pd->xlink = xmlNewNs(root, BAD_CAST
"http://www.w3.org/1999/xlink;, BAD_CAST "xlink");
-if(UNLIKELY(!pd->xlink)) return false;
-