Index: tocmacro-0.9/tractoc/macro.py =================================================================== --- tocmacro-0.9.orig/tractoc/macro.py 2006-06-20 06:34:54.000000000 -0500 +++ tocmacro-0.9/tractoc/macro.py 2006-06-20 06:35:02.000000000 -0500 @@ -17,12 +17,13 @@ class MyOutlineFormatter(OutlineFormatter): def format(self, active_page, page, text, out, min_depth, max_depth): - self.__page = page # XXX Code copied straight out of OutlineFormatter self.outline = [] - class NullOut(object): - def write(self, data): pass - Formatter.format(self, text, NullOut()) + Formatter.format(self, text) + + active = '' + if page == active_page: + active = ' class="active"' if min_depth > max_depth: min_depth, max_depth = max_depth, min_depth @@ -30,10 +31,7 @@ min_depth = max(1, min_depth) curr_depth = min_depth - 1 - for depth, link in self.outline: - active = '' - if '/%s' % active_page in link: - active = ' class="active"' + for depth, anchor, heading in self.outline: if depth < min_depth or depth > max_depth: continue if depth < curr_depth: @@ -43,18 +41,10 @@ else: out.write("