Modify

Opened 5 years ago

Closed 3 years ago

#9211 closed defect (fixed)

FootNote counters go recursive on formatters

Reported by: A. Przygienda Owned by: Ryan J Ollos
Priority: normal Component: FootNoteMacro
Severity: normal Keywords:
Cc: Andrew Schulman 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 Ryan J Ollos 5 years ago.
t9211.patch (2.8 KB) - added by Ryan J Ollos 3 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by Ryan J Ollos

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 5 years ago by Ryan J Ollos

Attachment: ConfirmsTheIssue.png added

comment:2 Changed 3 years ago by Ryan J Ollos

Cc: Andrew Schulman added; anonymous removed

#11057 closed as a duplicate.

comment:3 Changed 3 years ago by Ryan J Ollos

In 13552:

Added unit test harness. Refs #9211.

Changed 3 years ago by Ryan J Ollos

Attachment: t9211.patch added

comment:4 Changed 3 years ago by Ryan J Ollos

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

Version 0, edited 3 years ago by Ryan J Ollos (next)

comment:5 Changed 3 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 13654:

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.