Project

General

Profile

Actions

Feature #39884

closed

Allow multiple footnotes per single word

Added by Mischa The Evil almost 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Category:
Text formatting
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

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

Actions #1

Updated by Holger Just 12 months ago

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.

Actions #2

Updated by Marius BĂLTEANU 12 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!

Actions

Also available in: Atom PDF