Feature #39884
closedAllow multiple footnotes per single word
0%
Description
I stumbled upon this while trying to update RedmineInstall earlier today (v.336). The mention of "2.7" in the "Supported Ruby versions" column on the "4.2" row in the "Ruby interpreter and supported databases" table needs to have a reference to footnote #1 too, but this seems in no way possible to achieve currently.
This was found on redmine.org so applies to the Textile formatter. I haven't tested this with other formatters.
Files
Updated by Holger Just 11 months ago
- File 0001-Allow-consecutive-footnote-references-in-Textile-39884.patch 0001-Allow-consecutive-footnote-references-in-Textile-39884.patch added
The regular expression in Redcloth3#footnote_ref
matches the following for footnote-references:
def footnote_ref( text )
text.gsub!(/\b\[([0-9]+?)\](\s)?/,
'<sup><a href="#fn\1">\1</a></sup>\2')
end
Here, the \b
requirements is effectively the same as a positive-lookbehind for a unicode word-character (A member of one of the following Unicode general categories: Letter, Mark, Number, Connector_Punctuation), i.e. (?<=\p{Word})
. This lookbehind rule however does not match the ]
character of the first footnote reference.
This might be fixed by including this character in the explicit lookbehind rule, i.e. by changing the regex from \b
to (?<=[\p{Word}\]])
A full patch against Redmine trunk at r22537 is attached.
Updated by Marius BĂLTEANU 11 months ago
- Status changed from New to Closed
- Assignee set to Marius BĂLTEANU
- Target version set to 5.0.8
- Resolution set to Fixed
Committed and merged to stable branches, thanks!