Add AMA option for footnote link display

Created on 4 August 2022, almost 2 years ago
Updated 6 February 2024, 5 months ago

Problem/Motivation

The AMA requests that multiple concurrent footnote links are condensed together and separated with a dash, e.g. "1, 2, 3, 4" would be condensed to "1 - 4".

Proposed resolution

Provide a setting that condenses the output of multiple footnote links into AMA format.

Remaining tasks

Build the necessary change.
Add test coverage.

User interface changes

A global option would be provided to control the output.
When the option is enabled multiple concurrent footnote links would be condensed together and separated with a dash, e.g. "1, 2, 3, 4" would be condensed to "1 - 4".

So for example:

Lorem ipsum id nisl quis enim dignissim sagittis[1][2][3]. Sed a libero.

Should become:

Lorem ipsum nisl quis enim dignissim sagittis[1-3]. Sed a libero.

This means that the corresponding html code should be:

Lorem ipsum nisl quis enim dignissim sagittis<a href="..." id="backlink-id-for-1">[1-3]</a><span id="backlink-id-for-2"></span><span id="backlink-id-for-3"></span>. Sed a libero.

So that back-links within the references section for combined citations can actually still take the user back to the combined citation.

API changes

TBD

Data model changes

TBD

✨ Feature request
Status

Closed: outdated

Version

4.0

Component

Footnotes

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    This should be doable in footnote-list.html.twig, would also suggest this as a 4x change given it would affect live sites (same as https://www.drupal.org/project/footnotes/issues/3298390 ✨ Improve footnote links output Active )

  • πŸ‡¬πŸ‡§United Kingdom scott_euser
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    @DamienMcKenna Actually I think this does need to be part of the DOM parsing. Checking if there are directly adjacent citations within the text and then combining them and setting the link to go to the first number only + creating hidden spans for the backlinks. I will update the issue description - please have a look.

  • Status changed to Postponed: needs info 6 months ago
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Given that we now have footnotes-links.html.twig from ✨ Improve footnote links output Active , I wonder if this can be achieved via that template. Ie, combining them in twig. The footnotes-links.html.twig contains the group of citations that are direct siblings of each other. Hopefully someone is able to try this out when they next need it and see if it now satisfies that goal.

  • Status changed to Closed: outdated 5 months ago
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Going to close this; someone can re-open if needed but I cannot see why this cannot be easily achieved in twig now.

Production build 0.69.0 2024