diff --git a/0001-Fix-when-list-item-is-blank.-Refer-https-github.com-.patch b/0001-Fix-when-list-item-is-blank.-Refer-https-github.com-.patch new file mode 100644 index 0000000..0b82ee2 --- /dev/null +++ b/0001-Fix-when-list-item-is-blank.-Refer-https-github.com-.patch @@ -0,0 +1,30 @@ +From fd8c175668047c82d65f4da7e4ee8ff7900c17d3 Mon Sep 17 00:00:00 2001 +From: Hsiaoming Yang +Date: Wed, 4 Mar 2015 16:14:35 +0800 +Subject: [PATCH] Fix when list item is blank. Refer + https://github.com/ipython/ipython/issues/7929 + +--- + mistune.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/mistune.py b/mistune.py +index fe50c9d..b361539 100644 +--- a/mistune.py ++++ b/mistune.py +@@ -287,8 +287,10 @@ class BlockLexer(object): + loose = _next + if not loose and re.search(r'\n\n(?!\s*$)', item): + loose = True +- if i != length - 1: +- _next = item[len(item)-1] == '\n' ++ ++ rest = len(item) ++ if i != length - 1 and rest: ++ _next = item[rest-1] == '\n' + if not loose: + loose = _next + +-- +1.8.4.5 + diff --git a/python-mistune.changes b/python-mistune.changes index 0c3bacf..17682d0 100644 --- a/python-mistune.changes +++ b/python-mistune.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Mar 8 20:48:24 UTC 2015 - tbehrens@suse.com + +- Add 0001-Fix-when-list-item-is-blank.-Refer-https-github.com-.patch + to fix #8 in odpdown, and + https://github.com/ipython/ipython/issues/7929. This is a backport + from upstream master. + ------------------------------------------------------------------- Sat Feb 7 20:36:53 UTC 2015 - tbehrens@suse.com diff --git a/python-mistune.spec b/python-mistune.spec index 5008243..0caa8ca 100644 --- a/python-mistune.spec +++ b/python-mistune.spec @@ -22,6 +22,8 @@ Release: 0 Source0: https://pypi.python.org/packages/mistune/mistune-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: https://github.com/lepture/mistune +# PATCH-FIX-UPSTREAM Fix when list item is blank +Patch0: 0001-Fix-when-list-item-is-blank.-Refer-https-github.com-.patch Summary: The fastest markdown parser in pure Python License: BSD-3-Clause Group: Development/Languages/Python @@ -34,6 +36,7 @@ The fastest markdown parser in pure Python, inspired by marked. %prep %setup -q -n mistune-%{version} +%patch0 -p1 %build export CFLAGS="%{optflags}"