[ 
https://issues.apache.org/jira/browse/JSPWIKI-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18133548#comment-18133548
 ] 

Arturo Bernal commented on JSPWIKI-584:
---------------------------------------

I reproduced this on a running instance: Tomcat 10.1 with a build of master 
plus an unrelated parser change. The saved page TocPage has the table of 
contents plugin and one heading, Alpha. I sent a preview with the same text 
plus a second heading, Beta.

With the Preview button (Preview.jsp) and with the quick preview 
(AJAXPreview.jsp) the body shows both headings, but the table of contents lists 
only Alpha. So it still happens, as reported.

Cause: the plugin does not use the text that is being rendered. In 
TableOfContents.execute it reads the saved text with 
PageManager.getPureText(page) and parses that to collect the headings. In a 
preview the text being rendered is the edited text, which the plugin cannot 
reach, so it lists the headings of the saved version.

A fix needs the text being rendered to reach the plugin, for example as a 
context variable that the rendering manager sets while it translates a text, 
and that the plugin uses before falling back to the saved text. That adds a 
constant to the Context API, so I would like to hear if that is acceptable 
before writing it. Nothing is changed yet.

> ToC is not updated on Preview
> -----------------------------
>
>                 Key: JSPWIKI-584
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-584
>             Project: JSPWiki
>          Issue Type: Bug
>         Environment: JSPWiki-2.8.2, Tomcat 6.0.20, Red Hat Linux
> Firefox 3.5.1
>            Reporter: Stefan Bohn
>            Assignee: Janne Jalkanen
>            Priority: Minor
>
> If a page is edited, the ToC is not updatet when clicking the preview button. 
> Nor is it updated, if quick preview is shown.
> The update will only occur, when the page is saved.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to