Blame fix-image_link-regex.patch

e11fe9
From d649fc4dd4e20234404884a59a556e5a3793505b Mon Sep 17 00:00:00 2001
e11fe9
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
e11fe9
Date: Wed, 17 May 2017 10:06:52 +0200
e11fe9
Subject: [PATCH] Make image_link regex non-greedy
e11fe9
MIME-Version: 1.0
e11fe9
Content-Type: text/plain; charset=UTF-8
e11fe9
Content-Transfer-Encoding: 8bit
e11fe9
e11fe9
In case there is more than one image link on the same line,
e11fe9
the original regex would consume all of them.
e11fe9
Fix that.
e11fe9
e11fe9
Signed-off-by: Nikola Forrรณ <nforro@redhat.com>
e11fe9
---
e11fe9
 m2r.py | 2 +-
e11fe9
 1 file changed, 1 insertion(+), 1 deletion(-)
e11fe9
e11fe9
diff --git a/m2r.py b/m2r.py
e11fe9
index 80bc037..315773d 100644
e11fe9
--- a/m2r.py
e11fe9
+++ b/m2r.py
e11fe9
@@ -80,7 +80,7 @@ class RestBlockLexer(mistune.BlockLexer):
e11fe9
 
e11fe9
 class RestInlineGrammar(mistune.InlineGrammar):
e11fe9
     image_link = re.compile(
e11fe9
-        r'\[!\[(?P<alt>.*?)\]\((?P<url>.*?)\).*\]\((?P<target>.*?)\)'
e11fe9
+        r'\[!\[(?P<alt>.*?)\]\((?P<url>.*?)\).*?\]\((?P<target>.*?)\)'
e11fe9
     )
e11fe9
     rest_role = re.compile(r':.*?:`.*?`|`[^`]+`:.*?:')
e11fe9
     rest_link = re.compile(r'`[^`]*?`_')
e11fe9
-- 
e11fe9
2.7.4
e11fe9