Hello community, here is the log from the commit of package python3-mistune for openSUSE:Factory checked in at 2015-10-19 22:52:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-mistune (Old) and /work/SRC/openSUSE:Factory/.python3-mistune.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-mistune" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-mistune/python3-mistune.changes 2015-07-19 11:45:52.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3-mistune.new/python3-mistune.changes 2015-10-20 00:06:51.000000000 +0200 @@ -1,0 +2,6 @@ +Sat Oct 17 22:55:08 UTC 2015 - a...@gmx.de + +- update to version 0.7.1: + * Fix inline html when there is no content per #71. + +------------------------------------------------------------------- Old: ---- mistune-0.7.tar.gz New: ---- mistune-0.7.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-mistune.spec ++++++ --- /var/tmp/diff_new_pack.FP6AK7/_old 2015-10-20 00:06:52.000000000 +0200 +++ /var/tmp/diff_new_pack.FP6AK7/_new 2015-10-20 00:06:52.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-mistune -Version: 0.7 +Version: 0.7.1 Release: 0 Summary: The fastest markdown parser in pure Python License: BSD-3-Clause ++++++ mistune-0.7.tar.gz -> mistune-0.7.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mistune-0.7/CHANGES.rst new/mistune-0.7.1/CHANGES.rst --- old/mistune-0.7/CHANGES.rst 2015-07-18 14:35:33.000000000 +0200 +++ new/mistune-0.7.1/CHANGES.rst 2015-08-22 17:28:24.000000000 +0200 @@ -3,6 +3,16 @@ Here is the full history of mistune. +Version 0.7.1 +~~~~~~~~~~~~~ + +Released on Aug. 22, 2015 + +* Fix inline html when there is no content per `#71`_. + +.. _`#71`: https://github.com/lepture/mistune/issues/71 + + Version 0.7 ~~~~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mistune-0.7/PKG-INFO new/mistune-0.7.1/PKG-INFO --- old/mistune-0.7/PKG-INFO 2015-07-18 15:20:19.000000000 +0200 +++ new/mistune-0.7.1/PKG-INFO 2015-08-22 17:44:33.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: mistune -Version: 0.7 +Version: 0.7.1 Summary: The fastest markdown parser in pure Python Home-page: https://github.com/lepture/mistune Author: Hsiaoming Yang @@ -24,7 +24,7 @@ .. image:: https://coveralls.io/repos/lepture/mistune/badge.svg?branch=master :target: https://coveralls.io/r/lepture/mistune :alt: Coverage Status - .. image:: https://ci.appveyor.com/api/projects/status/8ai8tfwp75oela17 + .. image:: https://ci.appveyor.com/api/projects/status/8ai8tfwp75oela17?svg=true :target: https://ci.appveyor.com/project/lepture/mistune :alt: App Veyor CI Status @@ -93,6 +93,7 @@ * **escape**: if set to *False*, all raw html tags will not be escaped. * **hard_wrap**: if set to *True*, it will has GFM line breaks feature. + All new lines will be replaced with ``<br>`` tag * **use_xhtml**: if set to *True*, all tags will be in xhtml, for example: ``<hr />``. * **parse_block_html**: parse text only in block level html. * **parse_inline_html**: parse text only in inline level html. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mistune-0.7/README.rst new/mistune-0.7.1/README.rst --- old/mistune-0.7/README.rst 2015-07-18 14:41:33.000000000 +0200 +++ new/mistune-0.7.1/README.rst 2015-08-11 09:55:52.000000000 +0200 @@ -16,7 +16,7 @@ .. image:: https://coveralls.io/repos/lepture/mistune/badge.svg?branch=master :target: https://coveralls.io/r/lepture/mistune :alt: Coverage Status -.. image:: https://ci.appveyor.com/api/projects/status/8ai8tfwp75oela17 +.. image:: https://ci.appveyor.com/api/projects/status/8ai8tfwp75oela17?svg=true :target: https://ci.appveyor.com/project/lepture/mistune :alt: App Veyor CI Status @@ -85,6 +85,7 @@ * **escape**: if set to *False*, all raw html tags will not be escaped. * **hard_wrap**: if set to *True*, it will has GFM line breaks feature. + All new lines will be replaced with ``<br>`` tag * **use_xhtml**: if set to *True*, all tags will be in xhtml, for example: ``<hr />``. * **parse_block_html**: parse text only in block level html. * **parse_inline_html**: parse text only in inline level html. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mistune-0.7/mistune.egg-info/PKG-INFO new/mistune-0.7.1/mistune.egg-info/PKG-INFO --- old/mistune-0.7/mistune.egg-info/PKG-INFO 2015-07-18 15:20:17.000000000 +0200 +++ new/mistune-0.7.1/mistune.egg-info/PKG-INFO 2015-08-22 17:44:30.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: mistune -Version: 0.7 +Version: 0.7.1 Summary: The fastest markdown parser in pure Python Home-page: https://github.com/lepture/mistune Author: Hsiaoming Yang @@ -24,7 +24,7 @@ .. image:: https://coveralls.io/repos/lepture/mistune/badge.svg?branch=master :target: https://coveralls.io/r/lepture/mistune :alt: Coverage Status - .. image:: https://ci.appveyor.com/api/projects/status/8ai8tfwp75oela17 + .. image:: https://ci.appveyor.com/api/projects/status/8ai8tfwp75oela17?svg=true :target: https://ci.appveyor.com/project/lepture/mistune :alt: App Veyor CI Status @@ -93,6 +93,7 @@ * **escape**: if set to *False*, all raw html tags will not be escaped. * **hard_wrap**: if set to *True*, it will has GFM line breaks feature. + All new lines will be replaced with ``<br>`` tag * **use_xhtml**: if set to *True*, all tags will be in xhtml, for example: ``<hr />``. * **parse_block_html**: parse text only in block level html. * **parse_inline_html**: parse text only in inline level html. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mistune-0.7/mistune.py new/mistune-0.7.1/mistune.py --- old/mistune-0.7/mistune.py 2015-07-18 14:38:39.000000000 +0200 +++ new/mistune-0.7.1/mistune.py 2015-08-22 17:28:46.000000000 +0200 @@ -11,7 +11,7 @@ import re import inspect -__version__ = '0.7' +__version__ = '0.7.1' __author__ = 'Hsiaoming Yang <m...@lepture.com>' __all__ = [ 'BlockGrammar', 'BlockLexer', @@ -24,6 +24,8 @@ _key_pattern = re.compile(r'\s+') _escape_pattern = re.compile(r'&(?!#?\w+;)') _newline_pattern = re.compile(r'\r\n|\r') +_block_quote_leading_pattern = re.compile(r'^ *> ?', flags=re.M) +_block_code_leadning_pattern = re.compile(r'^ {4}', re.M) _inline_tags = [ 'a', 'em', 'strong', 'small', 's', 'cite', 'q', 'dfn', 'abbr', 'data', 'time', 'code', 'var', 'samp', 'kbd', 'sub', 'sup', 'i', 'b', 'u', 'mark', @@ -221,9 +223,8 @@ self.tokens.append({'type': 'newline'}) def parse_block_code(self, m): - code = m.group(0) - pattern = re.compile(r'^ {4}', re.M) - code = pattern.sub('', code) + # clean leading whitespace + code = _block_code_leadning_pattern.sub('', m.group(0)) self.tokens.append({ 'type': 'code', 'lang': None, @@ -307,9 +308,8 @@ def parse_block_quote(self, m): self.tokens.append({'type': 'block_quote_start'}) - cap = m.group(0) - pattern = re.compile(r'^ *> ?', flags=re.M) - cap = pattern.sub('', cap) + # clean leading > + cap = _block_quote_leading_pattern.sub('', m.group(0)) self.parse(cap) self.tokens.append({'type': 'block_quote_end'}) @@ -434,7 +434,7 @@ inline_html = re.compile( r'^(?:%s|%s|%s)' % ( r'<!--[\s\S]*?-->', - r'<(\w+%s)((?:%s)*?)>([\s\S]+?)<\/\1>' % (_valid_end, _valid_attr), + r'<(\w+%s)((?:%s)*?)>([\s\S]*?)<\/\1>' % (_valid_end, _valid_attr), r'<\w+%s(?:%s)*?>' % (_valid_end, _valid_attr), ) ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mistune-0.7/tests/test_extra.py new/mistune-0.7.1/tests/test_extra.py --- old/mistune-0.7/tests/test_extra.py 2015-07-13 09:41:24.000000000 +0200 +++ new/mistune-0.7.1/tests/test_extra.py 2015-08-12 16:37:37.000000000 +0200 @@ -54,6 +54,11 @@ ) assert '<span><strong>' in ret + ret = mistune.markdown( + '<a>http://lepture.com</a>', parse_inline_html=True, escape=False + ) + assert 'href' not in ret + def test_parse_block_html(): ret = mistune.markdown( @@ -79,3 +84,8 @@ def test_not_escape_block_tags(): text = '<h1>heading</h1> text' assert text in mistune.markdown(text, escape=False) + + +def test_not_escape_inline_tags(): + text = '<a name="top"></a>' + assert text in mistune.markdown(text, escape=False)