Opened 18 years ago
Closed 18 years ago
#4484 closed defect (duplicate)
OutlineFormatter messes up large titles with wiki formatting
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | wiki system | Version: | 0.10.3 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The OutlineFormatter class generates an array of titles from a page. I'm using TocMacro to generate a table of contents for my wiki pages, and some of the titles are messed up in the contents.
The bug is that OutlineFormatter (eventually, through the OneLinerFormatter) calls shorten_line on the original title text, then reformats to HTML. The shorten_line operation may throw away the closing tags of some wiki formatting, which will then cause the reformatting to HTML to go awry. This is probably most likely to happen if the title contains a link with a long URL.
The OneLinerFormatter should probably reformat to HTML, and then shorten the text in a manner that preserves the HTML tags, not counting the HTML tags as part of the text length.
The general problem of shortening wiki text is addressed in #2064.