diff --git a/wiki/macro/TableOfContents.py b/wiki/macro/TableOfContents.py index 8c267faf..0e208306 100644 --- a/wiki/macro/TableOfContents.py +++ b/wiki/macro/TableOfContents.py @@ -5,6 +5,7 @@ Optional integer argument: maximal depth of listing. @copyright: 2000, 2001, 2002 by Jürgen Hermann + @copyright: 2006 by Grégoire Détrez @license: GNU GPL, see COPYING for details. """ @@ -78,16 +79,22 @@ class TableOfContents: try: html = [ - self.macro.formatter.rawHTML(u'
'), - self.macro.formatter.rawHTML(u'

Sommaire

'), - self.macro.formatter.rawHTML(u'
'), - ''.join(self.result), - self.macro.formatter.rawHTML(u'
'), - self.macro.formatter.rawHTML(u'
'), - self.macro.formatter.rawHTML(u'
'), - self.macro.formatter.rawHTML(u''), + self.macro.formatter.open('div', True, {'id': 'tableOfContents'}), + self.macro.formatter.open('h2', False, {'id': 'toctitle'}), + self.macro.formatter.text(u'Sommaire'), + self.macro.formatter.close('h2', True), + self.macro.formatter.open('div', True, {'id': 'tableOfContentsList'}), + ''.join(self.result), + self.macro.formatter.close('div', True), + self.macro.formatter.close('div', True), + self.macro.formatter.open('div', False, {'class': 'visualClear'}), + self.macro.formatter.close('div', True), + self.macro.formatter.open('script', False, + {'type': 'text/javascript', + 'src': '/wiki/common/toc/toc.js'}), + self.macro.formatter.close('script', True), ] - return u'\n'.join(html) + return u''.join(html) except: return ''.join(self.result)