changeset 1964:911fe470bfae

WordIndex/TitleIndex: fix invalid <a> tag attribute
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 08 Apr 2007 20:43:34 +0200
parents de42f84ddb3c
children 388f477fd536
files MoinMoin/Page.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sat Apr 07 21:11:29 2007 +0200
+++ b/MoinMoin/Page.py	Sun Apr 08 20:43:34 2007 +0200
@@ -804,10 +804,16 @@
         if not self.exists():
             kw['css_class'] = 'nonexistent'
 
+        attachment_indicator = kw.get('attachment_indicator')
+        if attachment_indicator is None:
+            attachment_indicator = 0 # default is off
+        else:
+            del kw['attachment_indicator'] # avoid having this as <a> tag attribute
+
         link = self.link_to_raw(request, text, querystr, anchor, **kw)
 
         # Create a link to attachments if any exist
-        if kw.get('attachment_indicator', 0):
+        if attachment_indicator:
             from MoinMoin.action import AttachFile
             link += AttachFile.getIndicator(request, self.page_name)