Opened 2 years ago

Closed 4 weeks ago

FootNote counters go recursive on formatters

Reported by: Owned by: prz@… rjollos normal FootNoteMacro normal andrex 0.12

Description

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

XXX1

YYY1

1. 1. X

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

comment:1 Changed 2 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]]


comment:2 Changed 2 months ago by rjollos

#11057 closed as a duplicate.

comment:3 Changed 2 months ago by rjollos

In 13552:

Added unit test harness. Refs #9211.

comment:4 Changed 2 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 4 weeks ago by rjollos (previous) (diff)

comment:5 Changed 4 weeks 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.

Modify Ticket

Change Properties