[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

@ -14,7 +14,7 @@
@copyright: 2002-2004 by Jürgen Hermann <jh@web.de>
@license: GNU GPL, see COPYING for details.
Originally written by Thomas Waldmann.
Gustavo Niemeyer added wiki markup parsing of the quotes.
"""
@ -39,12 +39,12 @@ def execute(macro, args):
quotes = raw.splitlines()
quotes = [quote.strip() for quote in quotes]
quotes = [quote[2:] for quote in quotes if quote.startswith('1. ')]
if not quotes:
return (macro.formatter.highlight(1) +
_('No quotes on %(pagename)s.') % {'pagename': pagename} +
macro.formatter.highlight(0))
quote = random.choice(quotes)
page.set_raw_body(quote, 1)
out = StringIO.StringIO()
@ -52,6 +52,6 @@ def execute(macro, args):
page.send_page(macro.request, content_only=1, content_id="RandomQuote_%s" % wikiutil.quoteWikinameFS(page.page_name) )
quote = out.getvalue()
macro.request.redirect()
return quote