changeset 576:a4d66592dea7

text_x_arnica.get_image_alias: simplified stripping
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 07 Mar 2012 13:39:02 +0100
parents 0db77eb786fb
children 79d3e999dc16
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Wed Mar 07 13:33:52 2012 +0100
+++ b/data/plugin/parser/text_x_arnica.py	Wed Mar 07 13:39:02 2012 +0100
@@ -330,9 +330,11 @@
         for line in quotes:
             if line.startswith('[[') and line.endswith(']]') and '|' in line:
                 img, alias = line[2:-2].split('|', 1)
+                img = img.strip()
+                alias = alias.strip()
                 # don't count an image more than once and verify that it is an image
-                if  AttachFile.exists(self.request, self.pagename, img.strip()) and wikiutil.isPicture(img.strip()) and img.strip() not in image_alias.keys():
-                    image_alias[img.strip()] = (self.formatter.text(alias.strip()), counter, img)
+                if  AttachFile.exists(self.request, self.pagename, img) and wikiutil.isPicture(img) and img not in image_alias.keys():
+                    image_alias[img] = (self.formatter.text(alias), counter, img)
                     counter += 1
                 # ToDo add a placeholder image for not existing images but already defined 
         return image_alias