Ticket #3089 (closed defect: fixed)
Opened 6 years ago
Last modified 5 years ago
PageOutline macro in wiki preview still shows the outline of the last saved content
| Reported by: | dave@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | high | Milestone: | 0.11 |
| Component: | wiki system | Version: | 0.9.5 |
| Severity: | normal | Keywords: | macro |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
Top Heading
Second Level Heading
Second Level Heading 2
It's not 100% clear what it's supposed to be doing, since documentation is rather sparse... but on my page containing one top-level heading and several second-level headings, as in the source of this ticket (go to edit this item), PageOutline gives me a page outline containing just a single entry, for the top-level heading.
Attachments
Change History
comment:1 Changed 6 years ago by anonymous
comment:2 Changed 6 years ago by cboos
- Keywords macro added
- Milestone set to 0.10
- Owner changed from jonas to cboos
- Summary changed from PageOutline Macro shows only one level to PageOutline macro in wiki preview still shows the outline of the last saved content
This could only be fixed by making available the full content
of the currently rendered wiki text to the render_macro().
That would have the additional benefit of making the outline
work on any kind of content, not only wiki pages.
Actually, this can be achieved by passing the formatter
object to the macro, which is a useful thing to do anyway (see Trac-Dev:497).
comment:3 Changed 6 years ago by cboos
- Milestone changed from 0.10 to 0.11
As the above solution will implies some changes to the
IWikiMacroRenderer interface, I'll do that in the next
development cycle.
comment:4 Changed 5 years ago by cboos
- Resolution set to fixed
- Status changed from new to closed
This specific problem was fixed in r4452 by simply storing the text being formatted in the current formatter, so that macros (which now have access to the formatter) can also use this text for other purposes, like in this case, generating an outline of it.
In the future, the same effect could be achieved more efficiently by first parsing the text to be formatted, then making the whole Wiki-DOM tree (see #4431) available to the macros when rendering the tree, such that, in this case, the heading nodes could be extracted.



Actually it works once you confirm, but it's broken in Preview. I think in the Preview, the index is still looking at the last page saved.