Improve footnote links output (ie, the citations in the text)

Created on 19 July 2022, over 2 years ago
Updated 23 January 2024, 11 months ago

Problem/Motivation

The current module output of the citations within the text creates rather clunky output that's not as clean as it could be, e.g.:

<sup><a href="$link1">1</a></sup>
<sup>,</sup>
<sup><a href="$link2">3</a></sup>
<sup>,</sup>
<sup><a href="$link2">3</a></sup>

Because of the inherent whitespace added on each footnote item, it results in the output not being as clean as it should be.

Steps to reproduce

Add multiple footnotes beside each other in a text field.
Display the output.

Proposed resolution

Optimize the footnote links so that they follow the following format:

<sup><a href="$link1">1</a>, <a href="$link2">2</a>, <a href="$link2">2</a></sup>

This should be done in FootnotesFilter::process. Steps:

  1. For the xpath query loading footnotes, determine if there are multiple adjacent footnotes
  2. Build a render array and render the markup for the multiple adjacent footnotes
  3. Replace the DomNode content.

Remaining tasks

Create merge request

User interface changes

TBC

API changes

TBC

Data model changes

TBC

✨ Feature request
Status

Fixed

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024