[wiki] on arrete de balancer du HTML

Ces macros sont appel'ees par getpagelinks. Si elles balancent n'importe
quoi lorsqu'on cherche a obtenir leurs liens, CategoriePagePublique
n'apparait pas...

darcs-hash:20090427142002-bd074-46977e63783af21b013023b46ee7e289020f28a7.gz
This commit is contained in:
Antoine Durand-Gasselin 2009-04-27 16:20:02 +02:00
parent d91a411300
commit 6b0022645d
8 changed files with 25 additions and 23 deletions

View file

@ -9,7 +9,6 @@
def execute(macro, text): def execute(macro, text):
import md5 import md5
parseargs = text.split(',') parseargs = text.split(',')
if len(parseargs)<2: if len(parseargs)<2:
return '<small><strong class="error">MailTo macro must have at least two arguments</strong></small>' return '<small><strong class="error">MailTo macro must have at least two arguments</strong></small>'
@ -19,4 +18,4 @@ def execute(macro, text):
user_id = md5.md5( email.strip() ).hexdigest() user_id = md5.md5( email.strip() ).hexdigest()
url = 'http://www.gravatar.com/avatar.php?gravatar_id=%s&size=80' % user_id url = 'http://www.gravatar.com/avatar.php?gravatar_id=%s&size=80' % user_id
html = "<img src=\"%s\" alt=\"Gravatar\" />" % url html = "<img src=\"%s\" alt=\"Gravatar\" />" % url
return html return macro.formatter.rawHTML(html)

View file

@ -101,4 +101,4 @@ def execute(macro, args):
index = makeIndex(letter_list) index = makeIndex(letter_list)
html = index + html html = index + html
html += u'<br style="clear: both">' html += u'<br style="clear: both">'
return html return macro.formatter.rawHTML(html)

View file

@ -110,11 +110,11 @@ def execute (macro, text, args_re=None):
try: res = _execute (macro, text) try: res = _execute (macro, text)
except Exception, msg: except Exception, msg:
return """ return macro.formatter.rawHTML("""
<p><strong class="error"> <p><strong class="error">
Error: macro ProgressBar: %s</strong> </p> Error: macro ProgressBar: %s</strong> </p>
""" % escape ("%s" % msg) """ % escape ("%s" % msg))
return res return macro.formatter.rawHTML(res)
def _execute (macro, text): def _execute (macro, text):

View file

@ -27,6 +27,11 @@ import re
def execute (macro, args): def execute (macro, args):
_ = macro.request.getText _ = macro.request.getText
# return immediately if getting links for the current page
if request.mode_getpagelinks:
return ''
unknownuname = {} unknownuname = {}
missingemail = {} missingemail = {}
outofdateversion = 0 outofdateversion = 0

View file

@ -89,5 +89,3 @@ def execute(macro, args):
i += 1 i += 1
text+= macro.formatter.table(0) text+= macro.formatter.table(0)
return text return text

View file

@ -24,4 +24,4 @@ def execute(macro, text):
<embed src="%(youtubelink)s" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed> <embed src="%(youtubelink)s" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
</object> </object>
''' % {"youtubelink": url} ''' % {"youtubelink": url}
return html return macro.formatter.rawHTML(html)