Edgewall Software

Ticket #3089 (closed defect: fixed)

Opened 3 years ago

Last modified 2 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:

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

Changed 3 years ago by anonymous

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.

Changed 3 years ago by cboos

  • keywords macro added
  • 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
  • milestone set to 0.10

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).

Changed 3 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.

Changed 2 years ago by cboos

  • status changed from new to closed
  • resolution set to fixed

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.

Add/Change #3089 (PageOutline macro in wiki preview still shows the outline of the last saved content)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cboos. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.