Index: tocmacro-0.9/tractoc/macro.py =================================================================== --- tocmacro-0.9.orig/tractoc/macro.py 2006-06-20 06:55:37.000000000 -0500 +++ tocmacro-0.9/tractoc/macro.py 2006-06-20 07:19:10.000000000 -0500 @@ -1,12 +1,14 @@ # vim: expandtab tabstop=4 +import os +import re +import inspect + from trac.core import * -from trac.util import escape -from trac.wiki.formatter import Formatter, OutlineFormatter, wiki_to_oneliner, wiki_to_outline +from trac.wiki.formatter import Formatter, OutlineFormatter, wiki_to_oneliner, wiki_to_outline, system_message from trac.wiki.api import IWikiMacroProvider, WikiSystem from trac.wiki.model import WikiPage from StringIO import StringIO -import os, re, string, inspect __all__ = ['TracTocMacro'] @@ -108,7 +110,8 @@ return (page.text, page.exists) # Split the args - if not args: args = '' + if not args: + args = '' args = [x.strip() for x in args.split(',')] # Options inline = False @@ -167,17 +170,17 @@ title = formatter.outline[0][1] title = re.sub('<[^>]*>','', title) # Strip all tags header = ': ' + wiki_to_oneliner(title, self.env) - out.write('