From 524a92630d6f8e59247c9ec2162cd06163d16f98 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 8 Oct 2009 16:28:02 +0000 Subject: [PATCH] fix quoting --- module-tools.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/module-tools.py b/module-tools.py index 0a3be59f..4a01c97e 100755 --- a/module-tools.py +++ b/module-tools.py @@ -237,6 +237,10 @@ class Module: def html_href (url,text): return '%s'%(url,text) @staticmethod def html_anchor (url,text): return '%s'%(url,text) + # there must be some smarter means to do that - dirty for now + @staticmethod + def html_quote (text): + return text.replace('&','&').replace('<','<').replace('>','>') # only the fake error module has multiple titles def html_store_title (self, title): @@ -247,7 +251,7 @@ class Module: self.body += html def html_store_pre (self, text): if not hasattr(self,'body'): self.body='' - self.body += '
' + text + '
' + self.body += '
' + self.html_quote(text) + '
' def html_print (self, txt): if not self.options.www: @@ -299,10 +303,10 @@ span.error {text-weight:bold; color: red; } def html_dump_body(self): if hasattr(self,'titles'): for title in self.titles: - print ('
') - print '

',self.html_anchor(self.friendly_name(),title),'

' + print '

',self.html_anchor(self.friendly_name(),title),'

' if hasattr(self,'body'): print self.body + print '

',self.html_href('#','Back to top'),'

' #################### @staticmethod @@ -1374,9 +1378,9 @@ Branches: # in which case we do the actual printing in the second pass if options.www: if mode == "diff": - modetitle="Pending changes in %s"%options.www + modetitle="Changes to tag in %s"%options.www elif mode == "version": - modetitle="Version of latest tags in %s"%options.www + modetitle="Latest tags in %s"%options.www modules.append(error_module) error_module.html_dump_header(modetitle) for module in modules: -- 2.45.2