Opened 10 years ago

titleindex mode removes spaces

Reported by: Owned by: paresh.solanki@… Odd Simon Simonsen normal TocMacro normal 0.10

Description

[[TOC(MyPage, AnotherPage, titleindex)]]


results in this output

  TitleOfMyPage
TitleOfAnotherPage


I would have expected this

  Title Of My Page
Title Of Another Page


Of course, this is assuming that the title is correctly spaced in the first place. If the titleindex option is not used, the spacing is correct.

comment:1 Changed 9 years ago by Odd Simon Simonsen

Owner: changed from Alec Thomas to Odd Simon Simonsen new → assigned

This is fixed for 0.11 version as part of #1784 / [2801].

Leaving the ticket open in case I find the inspiration to dig into 0.10 code again.

comment:2 Changed 9 years ago by Odd Simon Simonsen

Status: assigned → new

Opened the code and had a look at it. This really is a Trac code problem - or probably related to how the TOC macro would like to use the Formatter code from Trac source. The TOC macro implements its own format method, but it is really just a copy of the Trac one with addition for highlighting of current page.

So, to test it I changed the MyOutlineFormatter in TOC macro to this - essentially just returning the result from Trac.

class MyOutlineFormatter(OutlineFormatter):
def format(self, active_page, page, text, out, min_depth, max_depth):
return OutlineFormatter.format(self, text, out, max_depth=6, min_depth=1)



Same problem. So this is derived from the inner workings of the various supporting methods of trac.wiki.formatter.Formatter. Looking at that code, I see there is no chance of me finding inspiration to try and solve this for TOC 0.10 version.

(Now where is that Trac 0.11 with proper workflow - need a way to unassign my ownership...)

Modify Ticket

Change Properties