Hello community,

here is the log from the commit of package python-textile for openSUSE:Factory 
checked in at 2019-06-17 10:34:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-textile (Old)
 and      /work/SRC/openSUSE:Factory/.python-textile.new.4811 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-textile"

Mon Jun 17 10:34:24 2019 rev:6 rq:710176 version:3.0.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-textile/python-textile.changes    
2018-05-04 11:30:02.170585325 +0200
+++ /work/SRC/openSUSE:Factory/.python-textile.new.4811/python-textile.changes  
2019-06-17 10:34:41.953223432 +0200
@@ -1,0 +2,7 @@
+Sun Jun  9 06:45:28 UTC 2019 - Sebastian Wagner <[email protected]>
+
+- update to version 3.0.4:
+ - BUGFIX: Restricted mode strips out CSS attributes again.
+ - Update travis to more current versions and test against current Pillow 
version.
+
+-------------------------------------------------------------------

Old:
----
  textile-3.0.3.tar.gz

New:
----
  textile-3.0.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-textile.spec ++++++
--- /var/tmp/diff_new_pack.3bkbzV/_old  2019-06-17 10:34:42.409223204 +0200
+++ /var/tmp/diff_new_pack.3bkbzV/_new  2019-06-17 10:34:42.413223202 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-textile
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,21 +12,21 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %bcond_without test
 Name:           python-textile
-Version:        3.0.3
+Version:        3.0.4
 Release:        0
 Summary:        Textile processing for python
 License:        BSD-3-Clause
 Group:          Development/Languages/Python
 Url:            http://github.com/textile/python-textile
 Source:         
https://files.pythonhosted.org/packages/source/t/textile/textile-%{version}.tar.gz
-Requires:       python-Pillow >= 3.0.0
+Requires:       python-Pillow
 Requires:       python-html5lib >= 0.999999999
 Requires:       python-six
 Recommends:     python-regex
@@ -36,7 +36,7 @@
 BuildRequires:  %{python_module setuptools}
 %if %{with test}
 # not needed as the test requires internet connection
-#BuildRequires:  %%{python_module Pillow >= 3.0.0}
+#BuildRequires:  %%{python_module Pillow}
 BuildRequires:  %{python_module html5lib >= 0.999999999}
 %endif
 BuildRequires:  fdupes

++++++ textile-3.0.3.tar.gz -> textile-3.0.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/CHANGELOG.textile 
new/textile-3.0.4/CHANGELOG.textile
--- old/textile-3.0.3/CHANGELOG.textile 2018-04-22 16:17:44.000000000 +0200
+++ new/textile-3.0.4/CHANGELOG.textile 2019-06-08 18:32:59.000000000 +0200
@@ -1,5 +1,9 @@
 h1. Textile Changelog
 
+h2. Version 3.0.4
+* BUGFIX: Restricted mode strips out CSS attributes again.
+* Update travis to more current versions and test against current Pillow 
version.
+
 h2. Version 3.0.3
 * BUGFIX: Improve handling code block following extended p block 
("#63":https://github.com/textile/python-textile/pull/63)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/CONTRIBUTORS.txt 
new/textile-3.0.4/CONTRIBUTORS.txt
--- old/textile-3.0.3/CONTRIBUTORS.txt  2018-04-10 16:20:24.000000000 +0200
+++ new/textile-3.0.4/CONTRIBUTORS.txt  2019-06-08 18:32:59.000000000 +0200
@@ -5,4 +5,5 @@
 Mark Pilgrim
 Alex Shiels
 Jason Samsa
-Kurt Raschke
\ No newline at end of file
+Kurt Raschke
+Dave Brondsema
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/MANIFEST.in 
new/textile-3.0.4/MANIFEST.in
--- old/textile-3.0.3/MANIFEST.in       2018-04-12 18:30:08.000000000 +0200
+++ new/textile-3.0.4/MANIFEST.in       2019-06-08 19:08:02.000000000 +0200
@@ -1,2 +1,10 @@
 include MANIFEST.in
 include tests/fixtures/README.txt
+recursive-include tests *.py
+include .coveragerc
+include CHANGELOG.textile
+include CONTRIBUTORS.txt
+include LICENSE.txt
+include pytest.ini
+include README.textile
+include requirements.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/PKG-INFO new/textile-3.0.4/PKG-INFO
--- old/textile-3.0.3/PKG-INFO  2018-04-22 16:20:36.000000000 +0200
+++ new/textile-3.0.4/PKG-INFO  2019-06-08 19:08:12.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: textile
-Version: 3.0.3
+Version: 3.0.4
 Summary: Textile processing for python.
 Home-page: http://github.com/textile/python-textile
 Author: Dennis Burke
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/requirements.txt 
new/textile-3.0.4/requirements.txt
--- old/textile-3.0.3/requirements.txt  2018-04-10 16:20:24.000000000 +0200
+++ new/textile-3.0.4/requirements.txt  2019-06-08 17:58:53.000000000 +0200
@@ -1,3 +1,3 @@
 html5lib>=1.0b10
-Pillow==3.0.0
+Pillow
 regex
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/tests/test_textile.py 
new/textile-3.0.4/tests/test_textile.py
--- old/textile-3.0.3/tests/test_textile.py     2018-04-10 16:20:24.000000000 
+0200
+++ new/textile-3.0.4/tests/test_textile.py     2019-06-08 18:32:59.000000000 
+0200
@@ -53,6 +53,46 @@
 
     assert result == expect
 
+    test = "p{color:blue}. is this blue?"
+    result = textile.textile_restricted(test)
+    expect = '\t<p>is this blue?</p>'
+
+    assert result == expect
+
+    test = """\
+table{border:1px solid black}.
+|={color:gray}. Your caption goes here
+|~.
+|{position:absolute}. A footer | foo |
+|-.
+|_{font-size:xxlarge}. header|_=. centered header|
+|~. bottom aligned|{background:red;width:200px}. asfd|"""
+    result = textile.textile_restricted(test, lite=False)
+    # styles from alignment hints like =. and ~. are ok
+    expect = '''\
+\t<table>
+\t<caption>Your caption goes here</caption>
+\t
+\t<tfoot>
+\t\t<tr>
+\t\t\t<td>A footer </td>
+\t\t\t<td> foo </td>
+\t\t</tr>
+\t</tfoot>
+\t<tbody>
+\t\t<tr>
+\t\t\t<th>header</th>
+\t\t\t<th style="text-align:center;">centered header</th>
+\t\t</tr>
+\t\t<tr>
+\t\t\t<td style="vertical-align:bottom;">bottom aligned</td>
+\t\t\t<td>asfd</td>
+\t\t</tr>
+\t</tbody>
+\t</table>'''
+
+    assert result == expect
+
 def test_unicode_footnote():
     html = textile.textile('текст[1]')
     assert re.compile(r'^\t<p>текст<sup class="footnote" 
id="fnrev([a-f0-9]{32})-1"><a href="#fn\1-1">1</a></sup></p>$', 
re.U).search(html) is not None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/textile/core.py 
new/textile-3.0.4/textile/core.py
--- old/textile-3.0.3/textile/core.py   2018-04-22 16:16:38.000000000 +0200
+++ new/textile-3.0.4/textile/core.py   2019-06-08 18:32:59.000000000 +0200
@@ -363,7 +363,7 @@
             if ';' in pt and ':' in tl:
                 ls[tl] = 2
 
-            atts = pba(atts)
+            atts = pba(atts, restricted=self.restricted)
             tabs = '\t' * len(tl)
             # If start is still None, set it to '', else leave the value
             # that we've already formatted.
@@ -961,7 +961,7 @@
         text = self.span(text)
         text = self.glyphs(text)
         url = self.shelveURL(self.encode_url(urlunsplit(uri_parts)))
-        attributes = parse_attributes(atts)
+        attributes = parse_attributes(atts, restricted=self.restricted)
         if title:
             # if the title contains unicode data, it is annoying to get Python
             # 2.6 and all the latter versions working properly.  But shelving
@@ -1078,7 +1078,7 @@
         }
 
         tag = qtags[tag]
-        atts = pba(atts)
+        atts = pba(atts, restricted=self.restricted)
         if cite:
             atts = '{0} cite="{1}"'.format(atts, cite.rstrip())
 
@@ -1131,7 +1131,7 @@
             atts.update(height=six.text_type(size[1]))
         atts.update(src=url)
         if attributes:
-            atts.update(parse_attributes(attributes))
+            atts.update(parse_attributes(attributes, 
restricted=self.restricted))
         if title:
             atts.update(title=title)
         if size:
@@ -1220,7 +1220,7 @@
             atts, content = m.groups()
             # cleanup
             content = content.strip()
-            atts = pba(atts)
+            atts = pba(atts, restricted=self.restricted)
 
             # split the content into the term and definition
             xm = re.match(r'^(.*?)[\s]*:=(.*?)[\s]*(=:|:=)?[\s]*$', content,
@@ -1306,7 +1306,7 @@
                     o.append(li)
             self.notelist_cache[index] = "\n".join(o)
             result = self.notelist_cache[index]
-        list_atts = pba(att)
+        list_atts = pba(att, restricted=self.restricted)
         result = '<ol{0}>\n{1}\n\t</ol>'.format(list_atts, result)
         return result
 
@@ -1351,7 +1351,7 @@
 
         # Ignores subsequent defs using the same label
         if 'def' not in self.notes[label]: # pragma: no branch
-            self.notes[label]['def'] = {'atts': pba(att), 'content':
+            self.notes[label]['def'] = {'atts': pba(att, 
restricted=self.restricted), 'content':
                     self.graf(content), 'link': link}
         return ''
 
@@ -1373,7 +1373,7 @@
         processed into the notes array. So now we can resolve the link numbers
         in the order we process the refs..."""
         atts, label, nolink = match.groups()
-        atts = pba(atts)
+        atts = pba(atts, restricted=self.restricted)
         nolink = nolink == '!'
 
         # Assign a sequence number to this reference if there isn't one already
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/textile/objects/block.py 
new/textile-3.0.4/textile/objects/block.py
--- old/textile-3.0.3/textile/objects/block.py  2018-04-10 16:20:24.000000000 
+0200
+++ new/textile-3.0.4/textile/objects/block.py  2019-06-08 18:32:59.000000000 
+0200
@@ -20,7 +20,7 @@
         self.cite = cite
         self.content = content
 
-        self.attributes = parse_attributes(atts)
+        self.attributes = parse_attributes(atts, 
restricted=self.textile.restricted)
         self.outer_tag = ''
         self.inner_tag = ''
         self.outer_atts = OrderedDict()
@@ -69,7 +69,7 @@
             if 'id' not in self.attributes:
                 self.attributes.update({'id': 'fn{0}'.format(fnid)})
             else:
-                supp_id = parse_attributes('(#fn{0})'.format(fnid))
+                supp_id = parse_attributes('(#fn{0})'.format(fnid), 
restricted=self.textile.restricted)
 
 
             if '^' not in self.atts:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/textile/objects/table.py 
new/textile-3.0.4/textile/objects/table.py
--- old/textile-3.0.3/textile/objects/table.py  2018-04-10 16:20:24.000000000 
+0200
+++ new/textile-3.0.4/textile/objects/table.py  2019-06-08 18:32:59.000000000 
+0200
@@ -17,7 +17,7 @@
 class Table(object):
     def __init__(self, textile, tatts, rows, summary):
         self.textile = textile
-        self.attributes = parse_attributes(tatts, 'table')
+        self.attributes = parse_attributes(tatts, 'table', 
restricted=self.textile.restricted)
         if summary:
             self.attributes.update(summary=summary.strip())
         self.input = rows
@@ -44,7 +44,7 @@
                 caption_re = re.compile(captionpattern, re.S)
                 cmtch = caption_re.match(row)
                 if cmtch:
-                    caption = Caption(**cmtch.groupdict())
+                    caption = Caption(restricted=self.textile.restricted, 
**cmtch.groupdict())
                     self.caption = '\n{0}'.format(caption.caption)
                     row = cmtch.group('row').lstrip()
                     if row == '':
@@ -60,7 +60,7 @@
                 colgroup_atts, cols = colgroup_data, None
                 if '|' in colgroup_data:
                     colgroup_atts, cols = colgroup_data.split('|', 1)
-                colgrp = Colgroup(cols, colgroup_atts)
+                colgrp = Colgroup(cols, colgroup_atts, 
restricted=self.textile.restricted)
                 self.colgroup = colgrp.process()
                 if row == '':
                     continue
@@ -79,13 +79,13 @@
                 if rgrp:
                     groups.append('\n\t{0}'.format(rgrp.process()))
                 rgrp = grptypes[grpmatch.group('part')](grpmatch.group(
-                    'rgrpatts'))
+                    'rgrpatts'), restricted=self.textile.restricted)
             row = grpmatch.group('row')
 
             rmtch = re.search(r'^(?P<ratts>{0}{1}\. )(?P<row>.*)'.format(
                 align_re_s, cls_re_s), row.lstrip())
             if rmtch:
-                row_atts = parse_attributes(rmtch.group('ratts'), 'tr')
+                row_atts = parse_attributes(rmtch.group('ratts'), 'tr', 
restricted=self.textile.restricted)
                 row = rmtch.group('row')
             else:
                 row_atts = {}
@@ -102,7 +102,7 @@
                             cls_re_s), cell, flags=re.S)
                 if cmtch:
                     catts = cmtch.group('catts')
-                    cell_atts = parse_attributes(catts, 'td')
+                    cell_atts = parse_attributes(catts, 'td', 
restricted=self.textile.restricted)
                     cell = cmtch.group('cell')
                 else:
                     cell_atts = {}
@@ -139,8 +139,8 @@
 
 
 class Caption(object):
-    def __init__(self, capts, cap, row):
-        self.attributes = parse_attributes(capts)
+    def __init__(self, capts, cap, row, restricted):
+        self.attributes = parse_attributes(capts, restricted=restricted)
         self.caption = self.process(cap)
 
     def process(self, cap):
@@ -149,17 +149,18 @@
 
 
 class Colgroup(object):
-    def __init__(self, cols, atts):
+    def __init__(self, cols, atts, restricted):
         self.row = ''
         self.attributes = atts
         self.cols = cols
+        self.restricted = restricted
 
     def process(self):
         enc = 'unicode'
         if six.PY2: # pragma: no branch
             enc = 'UTF-8'
 
-        group_atts = parse_attributes(self.attributes, 'col')
+        group_atts = parse_attributes(self.attributes, 'col', 
restricted=self.restricted)
         colgroup = ElementTree.Element('colgroup', attrib=group_atts)
         colgroup.text = '\n\t'
         if self.cols is not None:
@@ -168,7 +169,7 @@
             # colgroup is the first item in match_cols, the remaining items are
             # cols.
             for idx, col in enumerate(match_cols):
-                col_atts = parse_attributes(col.strip(), 'col')
+                col_atts = parse_attributes(col.strip(), 'col', 
restricted=self.restricted)
                 ElementTree.SubElement(colgroup, 'col', col_atts)
         colgrp = ElementTree.tostring(colgroup, encoding=enc)
         # cleanup the extra xml declaration if it exists, (python versions
@@ -205,9 +206,9 @@
 
 
 class _TableSection(object):
-    def __init__(self, tag, attributes):
+    def __init__(self, tag, attributes, restricted):
         self.tag = tag
-        self.attributes = parse_attributes(attributes)
+        self.attributes = parse_attributes(attributes, restricted=restricted)
         self.rows = []
 
     def process(self):
@@ -215,15 +216,15 @@
 
 
 class Thead(_TableSection):
-    def __init__(self, attributes):
-        super(Thead, self).__init__('thead', attributes)
+    def __init__(self, attributes, restricted):
+        super(Thead, self).__init__('thead', attributes, restricted)
 
 
 class Tbody(_TableSection):
-    def __init__(self, attributes):
-        super(Tbody, self).__init__('tbody', attributes)
+    def __init__(self, attributes, restricted):
+        super(Tbody, self).__init__('tbody', attributes, restricted)
 
 
 class Tfoot(_TableSection):
-    def __init__(self, attributes):
-        super(Tfoot, self).__init__('tfoot', attributes)
+    def __init__(self, attributes, restricted):
+        super(Tfoot, self).__init__('tfoot', attributes, restricted)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/textile/utils.py 
new/textile-3.0.4/textile/utils.py
--- old/textile-3.0.3/textile/utils.py  2018-04-10 16:20:24.000000000 +0200
+++ new/textile-3.0.4/textile/utils.py  2019-06-08 18:32:59.000000000 +0200
@@ -105,7 +105,7 @@
     out = re.sub(r'"$', '" ', out)
     return out
 
-def parse_attributes(block_attributes, element=None, include_id=True):
+def parse_attributes(block_attributes, element=None, include_id=True, 
restricted=False):
     vAlign = {'^': 'top', '-': 'middle', '~': 'bottom'}
     hAlign = {'<': 'left', '=': 'center', '>': 'right', '<>': 'justify'}
     style = []
@@ -136,10 +136,11 @@
         if m:
             style.append("vertical-align:{0}".format(vAlign[m.group(1)]))
 
-    m = re.search(r'\{([^}]*)\}', matched)
-    if m:
-        style.extend(m.group(1).rstrip(';').split(';'))
-        matched = matched.replace(m.group(0), '')
+    if not restricted:
+        m = re.search(r'\{([^}]*)\}', matched)
+        if m:
+            style.extend(m.group(1).rstrip(';').split(';'))
+            matched = matched.replace(m.group(0), '')
 
     m = re.search(r'\[([^\]]+)\]', matched, re.U)
     if m:
@@ -197,9 +198,9 @@
         result['width'] = width
     return result
 
-def pba(block_attributes, element=None, include_id=True):
+def pba(block_attributes, element=None, include_id=True, restricted=False):
     """Parse block attributes."""
-    attrs = parse_attributes(block_attributes, element, include_id)
+    attrs = parse_attributes(block_attributes, element, include_id, restricted)
     if not attrs:
         return ''
     result = ' '.join(['{0}="{1}"'.format(k, v) for k, v in attrs.items()])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/textile/version.py 
new/textile-3.0.4/textile/version.py
--- old/textile-3.0.3/textile/version.py        2018-04-22 16:17:44.000000000 
+0200
+++ new/textile-3.0.4/textile/version.py        2019-06-08 18:34:25.000000000 
+0200
@@ -1 +1 @@
-VERSION = '3.0.3'
+VERSION = '3.0.4'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.3/textile.egg-info/PKG-INFO 
new/textile-3.0.4/textile.egg-info/PKG-INFO
--- old/textile-3.0.3/textile.egg-info/PKG-INFO 2018-04-22 16:20:36.000000000 
+0200
+++ new/textile-3.0.4/textile.egg-info/PKG-INFO 2019-06-08 19:08:12.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: textile
-Version: 3.0.3
+Version: 3.0.4
 Summary: Textile processing for python.
 Home-page: http://github.com/textile/python-textile
 Author: Dennis Burke


Reply via email to