Modify

Opened 7 years ago

Last modified 7 years ago

#1616 new defect

titleindex mode removes spaces

Reported by: Paresh.Solanki@… Owned by: osimons
Priority: normal Component: TocMacro
Severity: normal Keywords:
Cc: Trac Release: 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.

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by osimons

  • Owner changed from athomas to osimons
  • Status changed from new to 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 7 years ago by osimons

  • Status changed from assigned to 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...)

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.