changeset 2869:592c045c81c5

Creole parser: Use wikiutil.isPicture to recognize images
author Radomir Dopieralski <moindev@sheep.art.pl>
date Tue, 25 Sep 2007 22:30:07 +0200
parents 7b0b85f96fa2
children 8b1f57b626b7
files MoinMoin/parser/text_creole.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_creole.py	Mon Sep 24 00:59:26 2007 +0200
+++ b/MoinMoin/parser/text_creole.py	Tue Sep 25 22:30:07 2007 +0200
@@ -274,11 +274,10 @@
 
         target = groups.get('image_target', '').strip()
         text = (groups.get('image_text', '') or '').strip()
-        kind = 'attachment'
-        if (target.endswith('.png') or
-            target.endswith('.gif') or
-            target.endswith('.jpg')):
-                kind = 'image'
+        if wikiutil.isPicture(target):
+            kind = 'image'
+        else:
+            kind = 'attachment'
         node = DocNode(kind, self.cur, target)
         DocNode('text', node, text or node.content)
         self.text = None