Hello community,

here is the log from the commit of package python-textile for openSUSE:Factory 
checked in at 2018-05-04 11:29:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-textile (Old)
 and      /work/SRC/openSUSE:Factory/.python-textile.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-textile"

Fri May  4 11:29:56 2018 rev:5 rq:603209 version:3.0.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-textile/python-textile.changes    
2017-11-27 22:17:32.884514218 +0100
+++ /work/SRC/openSUSE:Factory/.python-textile.new/python-textile.changes       
2018-05-04 11:30:02.170585325 +0200
@@ -1,0 +2,14 @@
+Mon Apr 23 07:29:51 UTC 2018 - [email protected]
+
+- update to version 3.0.3:
+ * BUGFIX: Improve handling code block following extended p block (#63)
+
+-------------------------------------------------------------------
+Thu Apr 12 19:09:52 UTC 2018 - [email protected]
+
+- update to version 3.0.2:
+ * Fix for multiple multi-line paragraphs. (#62)
+- update to version 3.0.1:
+ * Fix improper handling of extended code blocks. (#61)
+
+-------------------------------------------------------------------

Old:
----
  textile-3.0.0-withtests.tar.gz

New:
----
  textile-3.0.3.tar.gz

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

Other differences:
------------------
++++++ python-textile.spec ++++++
--- /var/tmp/diff_new_pack.PrUZVx/_old  2018-05-04 11:30:04.166512095 +0200
+++ /var/tmp/diff_new_pack.PrUZVx/_new  2018-05-04 11:30:04.170511948 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-textile
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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
@@ -19,13 +19,13 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %bcond_without test
 Name:           python-textile
-Version:        3.0.0
+Version:        3.0.3
 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}-withtests.tar.gz
+Source:         
https://files.pythonhosted.org/packages/source/t/textile/textile-%{version}.tar.gz
 Requires:       python-Pillow >= 3.0.0
 Requires:       python-html5lib >= 0.999999999
 Requires:       python-six

++++++ textile-3.0.0-withtests.tar.gz -> textile-3.0.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.0/CHANGELOG.textile 
new/textile-3.0.3/CHANGELOG.textile
--- old/textile-3.0.0/CHANGELOG.textile 2017-11-17 16:37:57.000000000 +0100
+++ new/textile-3.0.3/CHANGELOG.textile 2018-04-22 16:17:44.000000000 +0200
@@ -1,5 +1,14 @@
 h1. Textile Changelog
 
+h2. Version 3.0.3
+* BUGFIX: Improve handling code block following extended p block 
("#63":https://github.com/textile/python-textile/pull/63)
+
+h2. Version 3.0.2
+* BUGFIX: Fix for multiple multi-line paragraphs. 
("#62":https://github.com/textile/python-textile/pull/62)
+
+h2. Version 3.0.1
+* BUGFIX: Fix improper handling of extended code blocks. 
("#61":https://github.com/textile/python-textile/pull/61)
+
 h2. Version 3.0.0
 * Drop support for Python 2.6 and 3.2.
 * Update to the current version of html5lib
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.0/PKG-INFO new/textile-3.0.3/PKG-INFO
--- old/textile-3.0.0/PKG-INFO  2017-11-17 16:38:15.000000000 +0100
+++ new/textile-3.0.3/PKG-INFO  2018-04-22 16:20:36.000000000 +0200
@@ -1,12 +1,11 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: textile
-Version: 3.0.0
+Version: 3.0.3
 Summary: Textile processing for python.
 Home-page: http://github.com/textile/python-textile
 Author: Dennis Burke
 Author-email: [email protected]
 License: UNKNOWN
-Description-Content-Type: UNKNOWN
 Description: UNKNOWN
 Keywords: textile,text,html markup
 Platform: UNKNOWN
@@ -27,3 +26,6 @@
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
+Provides-Extra: regex
+Provides-Extra: develop
+Provides-Extra: imagesize
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.0/tests/test_github_issues.py 
new/textile-3.0.3/tests/test_github_issues.py
--- old/textile-3.0.0/tests/test_github_issues.py       2017-11-17 
16:37:57.000000000 +0100
+++ new/textile-3.0.3/tests/test_github_issues.py       2018-04-22 
16:16:38.000000000 +0200
@@ -258,7 +258,150 @@
               'return configs;\n}\n}</pre>')
     assert result == expect
 
-def test_issue_56():
+def test_github_issue_56():
+    """Empty description lists throw error"""
     result = textile.textile("- :=\n-")
     expect = '<dl>\n</dl>'
     assert result == expect
+
+def test_github_pull_61():
+    """Fixed code block multiline encoding on quotes/span"""
+    test = '''bc.. This is some TEXT inside a "Code BLOCK"
+
+{
+  if (JSON) {
+
+    return {"JSON":"value"}
+  }
+}
+
+Back to 10-4 CAPS 
+
+p.. Some multiline Paragragh
+
+Here is some output!!! "Some" CAPS'''
+
+    expect = '''<pre><code>This is some TEXT inside a &quot;Code BLOCK&quot;
+
+{
+  if (JSON) {
+
+    return {&quot;JSON&quot;:&quot;value&quot;}
+  }
+}
+
+Back to 10-4 CAPS </code></pre>
+
+<p>Some multiline Paragragh</p>
+
+<p>Here is some output!!! &#8220;Some&#8221; <span 
class="caps">CAPS</span></p>'''
+    t = textile.Textile()
+    result = t.parse(test)
+    assert result == expect
+
+def test_github_pull_62():
+    """Fix for paragraph multiline, only last paragraph is rendered
+    correctly"""
+    test = '''p.. First one 'is'
+
+ESCAPED "bad"
+
+p.. Second one 'is'
+
+
+
+ESCAPED "bad"
+
+p.. Third one 'is'
+
+ESCAPED "bad"
+
+p.. Last one 'is'
+
+ESCAPED "good" test'''
+
+    expect = '''<p>First one &#8216;is&#8217;</p>
+
+<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>
+
+<p>Second one &#8216;is&#8217;</p>
+
+
+
+<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>
+
+<p>Third one &#8216;is&#8217;</p>
+
+<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>
+
+<p>Last one &#8216;is&#8217;</p>
+
+<p><span class="caps">ESCAPED</span> &#8220;good&#8221; test</p>'''
+    t = textile.Textile()
+    result = t.parse(test)
+    assert result == expect
+
+def test_github_pull_63():
+    """Forgot to set multiline_para to False"""
+    test = '''p.. First one 'is'
+
+ESCAPED "bad"
+
+bc.. {
+ First code BLOCK
+
+ {"JSON":'value'}
+}
+
+p.. Second one 'is'
+
+
+
+ESCAPED "bad"
+
+p.. Third one 'is'
+
+ESCAPED "bad"
+
+bc.. {
+ Last code BLOCK
+
+ {"JSON":'value'}
+}
+
+p.. Last one 'is'
+
+ESCAPED "good" test'''
+
+    expect = '''<p>First one &#8216;is&#8217;</p>
+
+<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>
+
+<pre><code>{
+ First code BLOCK
+
+ {&quot;JSON&quot;:&#39;value&#39;}
+}</code></pre>
+
+<p>Second one &#8216;is&#8217;</p>
+
+
+
+<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>
+
+<p>Third one &#8216;is&#8217;</p>
+
+<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>
+
+<pre><code>{
+ Last code BLOCK
+
+ {&quot;JSON&quot;:&#39;value&#39;}
+}</code></pre>
+
+<p>Last one &#8216;is&#8217;</p>
+
+<p><span class="caps">ESCAPED</span> &#8220;good&#8221; test</p>'''
+    t = textile.Textile()
+    result = t.parse(test)
+    assert result == expect
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.0/textile/core.py 
new/textile-3.0.3/textile/core.py
--- old/textile-3.0.0/textile/core.py   2017-11-17 16:37:57.000000000 +0100
+++ new/textile-3.0.3/textile/core.py   2018-04-22 16:16:38.000000000 +0200
@@ -433,6 +433,12 @@
         # the case, we'd want to drop the whitespace which comes after it.
         eat_whitespace = False
 
+        # check to see if previous block has already been escaped
+        escaped = False
+
+        # check if multiline paragraph (p..) tags <p>..</p> are added to line
+        multiline_para = False
+
         tag = 'p'
         atts = cite = ext = ''
 
@@ -458,11 +464,17 @@
                 if ext and out:
                     # it's out[-2] because the last element in out is the
                     # whitespace that preceded this line
-                    content = encode_html(out[-2], quotes=True)
-                    content = generate_tag(block.inner_tag, content,
-                            block.inner_atts)
-                    content = generate_tag(block.outer_tag, content,
-                        block.outer_atts)
+                    if not escaped:
+                        content = encode_html(out[-2], quotes=True)
+                        escaped = True
+                    else:
+                        content = out[-2]
+
+                    if not multiline_para:
+                        content = generate_tag(block.inner_tag, content,
+                                block.inner_atts)
+                        content = generate_tag(block.outer_tag, content,
+                            block.outer_atts)
                     out[-2] = content
                 tag, atts, ext, cite, content = match.groups()
                 block = Block(self, **match.groupdict())
@@ -479,11 +491,18 @@
                     # pre tags and raw text won't be indented.
                     if block.outer_tag != 'pre' and not has_raw_text(line):
                         line = "\t{0}".format(line)
+
+            # set having paragraph tags to false
+                if block.tag == 'p' and ext:
+                    multiline_para = False
             # no tag specified
             else:
                 # if we're inside an extended block, add the text from the
                 # previous line to the front
                 if ext and out:
+                    if block.tag == 'p':
+                        line = generate_tag(block.tag, line, block.outer_atts)
+                        multiline_para = True
                     line = '{0}{1}'.format(out.pop(), line)
                 # the logic in the if statement below is a bit confusing in
                 # php-textile. I'm still not sure I understand what the php
@@ -503,12 +522,23 @@
                                 block.outer_atts)
                         line = "\t{0}".format(line)
                 else:
-                    if block.tag == 'pre':
+                    if block.tag == 'pre' or block.inner_tag == 'code':
                         line = self.shelve(encode_html(line, quotes=True))
                     else:
                         line = self.graf(line)
 
-            line = self.doPBr(line)
+                    if block.tag == 'p':
+                        escaped = True
+
+            if block.tag == 'p' and ext and not multiline_para:
+                line = generate_tag(block.tag, line, block.outer_atts)
+                multiline_para = True
+            else:
+                line = self.doPBr(line)
+
+            if not block.tag == 'p':
+                multiline_para = False
+
             line = line.replace('<br>', '<br />')
 
             # if we're in an extended block, and we haven't specified a new
@@ -533,7 +563,7 @@
 
         # at this point, we've gone through all the lines, and if there's still
         # an extension in effect, we close it here.
-        if ext and out:
+        if ext and out and not block.tag == 'p':
             block.content = out.pop()
             block.process()
             final = generate_tag(block.outer_tag, block.content,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.0/textile/version.py 
new/textile-3.0.3/textile/version.py
--- old/textile-3.0.0/textile/version.py        2017-11-17 16:37:57.000000000 
+0100
+++ new/textile-3.0.3/textile/version.py        2018-04-22 16:17:44.000000000 
+0200
@@ -1 +1 @@
-VERSION = '3.0.0'
+VERSION = '3.0.3'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/textile-3.0.0/textile.egg-info/PKG-INFO 
new/textile-3.0.3/textile.egg-info/PKG-INFO
--- old/textile-3.0.0/textile.egg-info/PKG-INFO 2017-11-17 16:38:15.000000000 
+0100
+++ new/textile-3.0.3/textile.egg-info/PKG-INFO 2018-04-22 16:20:36.000000000 
+0200
@@ -1,12 +1,11 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: textile
-Version: 3.0.0
+Version: 3.0.3
 Summary: Textile processing for python.
 Home-page: http://github.com/textile/python-textile
 Author: Dennis Burke
 Author-email: [email protected]
 License: UNKNOWN
-Description-Content-Type: UNKNOWN
 Description: UNKNOWN
 Keywords: textile,text,html markup
 Platform: UNKNOWN
@@ -27,3 +26,6 @@
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
+Provides-Extra: regex
+Provides-Extra: develop
+Provides-Extra: imagesize


Reply via email to