| View previous topic :: View next topic |
| Author |
Message |
Hirmus
Joined: 13 Nov 2008 Posts: 2
|
|
| Back to top |
|
 |
jens Administrator
Joined: 12 Oct 2005 Posts: 972 Location: duisburg, germany
|
|
| Back to top |
|
 |
sepharim
Joined: 27 Dec 2007 Posts: 180 Location: Germany
|
Posted: Fri 14 Nov, 2008 10:59 Post subject: Re: creole.py |
|
|
| Hirmus wrote: | | Code: | | (?P<image_target>.+?\.jpg|\.jpeg|\.gif|\.png) \s* |
|
wenn ich RegEx richtig verstehe match das hier auf
| Hirmus wrote: | | Code: | | (?P<image_target>.+?(\.jpg|\.jpeg|\.gif|\.png)) \s* |
|
und dieses hier auf
.+?.jpg
.+?.jpeg
.+?.gif
.+?.png
|
|
| Back to top |
|
 |
Hirmus
Joined: 13 Nov 2008 Posts: 2
|
Posted: Fri 14 Nov, 2008 11:53 Post subject: |
|
|
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 |
|
 |
jens Administrator
Joined: 12 Oct 2005 Posts: 972 Location: duisburg, germany
|
|
| Back to top |
|
 |
|