FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

creole.py

 
Post new topic   Reply to topic    PyLucid - CMS - Forum Forum Index -> general
View previous topic :: View next topic  
Author Message
Hirmus



Joined: 13 Nov 2008
Posts: 2

PostPosted: Thu 13 Nov, 2008 16:12    Post subject: creole.py Reply with quote

Hi

creole.py, line 73
Code:
               (?P<image_target>.+?\.jpg|\.jpeg|\.gif|\.png) \s*

but better is
Code:
               (?P<image_target>.+?(\.jpg|\.jpeg|\.gif|\.png)) \s*


http://trac.pylucid.net/browser/trunk/pylucid_project/PyLucid/system/markups/creole.py
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Thu 13 Nov, 2008 21:00    Post subject: Reply with quote

Thank you for reporting this. But can you give me some example text?
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
sepharim



Joined: 27 Dec 2007
Posts: 180
Location: Germany

PostPosted: Fri 14 Nov, 2008 10:59    Post subject: Re: creole.py Reply with quote

Hirmus wrote:
Code:
               (?P<image_target>.+?\.jpg|\.jpeg|\.gif|\.png) \s*

wenn ich RegEx richtig verstehe match das hier auf
    .+?.jpg
    .jpeg
    .gif
    .png

Hirmus wrote:
Code:
               (?P<image_target>.+?(\.jpg|\.jpeg|\.gif|\.png)) \s*

und dieses hier auf
    .+?.jpg
    .+?.jpeg
    .+?.gif
    .+?.png
Back to top
View user's profile Send private message
Hirmus



Joined: 13 Nov 2008
Posts: 2

PostPosted: Fri 14 Nov, 2008 11:53    Post subject: Reply with quote

make test, create new creole markup document
Code:

Image {{image.png}}

and you get error

lets do some fast test on command line
Code:

$ ./manage.py shell
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from PyLucid.system.markups.creole2html import Parser, HtmlEmitter
>>> HtmlEmitter(Parser('img - {{image.png|Image}}').parse()).emit()
u'<p>img - {{image.png|Image}}</p>\n'
>>> HtmlEmitter(Parser('img - {{image.jpg|Image}}').parse()).emit()
u'<p>img - <img src="image.jpg" alt="Image"></p>\n'
>>>


currently only .jpg can be image ...
Back to top
View user's profile Send private message
jens
Administrator


Joined: 12 Oct 2005
Posts: 972
Location: duisburg, germany

PostPosted: Fri 14 Nov, 2008 12:06    Post subject: Reply with quote

Thx.

Fixed in http://trac.pylucid.net/changeset/1795 and i add a unitest for it.
_________________

http://www.jensdiemer.de | http://www.htfx.de | http://www.python-forum.de
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PyLucid - CMS - Forum Forum Index -> general All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

<< back to PyLucid CMS Homepage



Powered by phpBB © 2001, 2005 phpBB Group