Modify

Opened 3 years ago

Closed 10 months ago

#9211 closed defect (fixed)

FootNote counters go recursive on formatters

Reported by: prz@… Owned by: rjollos
Priority: normal Component: FootNoteMacro
Severity: normal Keywords:
Cc: andrex Trac Release: 0.12

Description

OK, here's the problem, when doing the following

XXX1

YYY2


  1. 1. X
  2. 2. Y

the 'internal' footnotes are not printed, they are only printed if you give empty footnote before end of formatter. That would be not bad but in the formatter the footnote numbering starts again at 1. Very confusing.

Solution would be to either carry counters across formatters or inside formatter do (i) or letters or something like this

Attachments (2)

ConfirmsTheIssue.png (17.5 KB) - added by rjollos 3 years ago.
t9211.patch (2.8 KB) - added by rjollos 11 months ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 3 years ago by rjollos

I think your example didn't display correctly here on Trac 0.10.6, so I threw the following into 0.12.2 to confirm the issue:

OK, here's the problem, when doing the following

XXX[[FootNote(X)]]


{{{
#!div style="margin-left:2em"

YYY[[FootNote(Y)]]
[[FootNote]]
}}}

ZZZ[[FootNote(Z)]]

[[FootNote]]

Changed 3 years ago by rjollos

comment:2 Changed 11 months ago by rjollos

  • Cc andrex added; anonymous removed

#11057 closed as a duplicate.

comment:3 Changed 11 months ago by rjollos

In 13552:

Added unit test harness. Refs #9211.

Changed 11 months ago by rjollos

comment:4 Changed 11 months ago by rjollos

The issue is due to the footnotes being bound to the Formatter object.

When rendering a page, the template wiki_view.html calls format_to_html, which instantiates an HtmlFormatter, which instantiates a Formatter. When formatting a td tablecell, format_to_html` is called again, and a new Formatter object is constructed.

Therefore the footnotes bound to the Formatter in the table cell are not visible outside of the table cell.

The only way I can see to fix this is to bind the footnotes to the context. t9211.patch implements that change. Please test it out and let me know if you find any cases that don't format properly. I will add unit tests and increment the version.

Last edited 10 months ago by rjollos (previous) (diff)

comment:5 Changed 10 months ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

In 13654:

1.0.4: Attach footnotes to the context to avoid scoping issues when formatting the page. Fixes #9211.

Add Comment

Modify Ticket

Action
as closed The owner will remain rjollos.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.