diff --git a/syntaxreference.txt b/syntaxreference.txt index 9501ff2..db0fe22 100644 --- a/syntaxreference.txt +++ b/syntaxreference.txt @@ -74,6 +74,15 @@ foo = new something(1, "soo\nice") * [file://servername/full/path/to/file/filename%20with%20spaces.txt Click here to read filename with spaces.txt] * me@privacy.net +== Escaping WikiNames == +{{{ +Wiki''''''Name +Wiki``Name +}}} +Wiki''''''Name +Wiki``Name + + = Bullet list = {{{ * item 1 diff --git a/text_dokuwiki.py b/text_dokuwiki.py index 382b102..fc35c5e 100644 --- a/text_dokuwiki.py +++ b/text_dokuwiki.py @@ -198,11 +198,23 @@ class Formatter(FormatterBase): def image(self, src=None, **kw): valid_attrs = ['src', 'width', 'height', 'alt', 'title'] - attrs = {'src': src} + + url = src + if '?' in url: + url += '&' + else: + url += '?' + + attrs = {} for key, value in kw.items(): if key in valid_attrs: attrs[key] = value - return apply(FormatterBase.image, (self,), attrs) + '' + + # TODO: finish this + if attrs.has_key('width'): + url += attrs['width'] + + return '{{' + url + '}}' def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1): syntax = ''