Delimiters used by other filters are printed, not interpreted

Created on 14 January 2024, about 1 year ago
Updated 16 April 2024, 12 months ago

Problem/Motivation

Our text, including footnote text, delimits text thus: @Source Table Item@. The delimiter could be some other character, such as #Source Table Item#. A filter replaces the delmited text with a link to a row in a table of sources.

With footnotes 3.x the delmiteters in footnote text are correctly removed and replaced to a link to a row in a table of sources. With footnotes 4.x the delmiters are simply printed, regardless of whether Footnotes filter runs before or after the filter which handles the delimiters.

Proposed resolution

Allow footnote text to be processed by other filters in the same way that text outside footnotes is.

🐛 Bug report
Status

Closed: cannot reproduce

Version

4.0

Component

Footnotes

Created by

🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)

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

Comments & Activities

  • Issue created by @John_B
  • Status changed to Postponed: needs info about 1 year ago
  • 🇬🇧United Kingdom scott_euser

    Sorry same thing here, can you provide steps + example markup/content + screenshots where possible? I am volunteering my own time so ideally would have as clear steps as possible so I can focus on providing the functionality you expect. Thanks!

  • 🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)

    The delimited by @...@ is converted to links to the sources table.

    if you compare the HTML source which I pasted at

    https://www.drupal.org/project/footnotes/issues/3414604#comment-15397449 🐛 Support adding the text content within the element Fixed with the HTML source of https://www.givewell.org/charities/malaria-consortium you can how the link is grabbed from the Source table at the bottom of the page, and used to turn delimited text into links.

  • 🇬🇧United Kingdom scott_euser

    If I understand correctly, in your markup (after 🐛 Support adding the text content within the element Fixed is in) you will have:

    <footnotes data-value="">Some text with @https://drupal.org@.<footnotes>

    and:

    1. you expect the @https://drupal.org@ to be converted to <a href="https://drupal.org">https://drupal.org</a>
    2. you are saying 3x supported that conversion
    3. you had some way to specify whether the character was @, or #, or something else

    Is that correct? So you effectively have your content editors writing some combination of html and custom markdown-ish like thing. I do not see that documented in 3x anywhere, could you point me to where it is? I also tried searching the Filter itself and do not see any reference to that in 3x here.

    Seems a bit dangerous to auto-convert anything between two @ signs or two # signs for example. What if the content editor legitimately wants to use those characters. Seems like this is perhaps better moved to Provide a drush command upgrade path for 3x to 4x to convert from [fn] and to the new modal window Needs work to migrate away from that perhaps?

  • 🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)

    Converting text between delimiters can cause problems. We do convert text between @...@ using custom code. If it becomes a probem will configure more unusual characters as the delimiters.

    This kind of thing is not unusual. Mathjax does it on the frontend to format mathematical notation. There is no documentation indicating whether Footnotes 3.x. supports it. However, it did not break Footnotes 3.x. There are many other situations where HTML which does not comply strictly with the HTML 5 standard works, and is used. CKEditor 5 and Guteberg both use far wilder non-standard HTML than this.

  • 🇬🇧United Kingdom scott_euser

    However, it did not break Footnotes 3.x.

    And it breaks in 4x? Howabout with the code from 🐛 Support adding the text content within the element Fixed ? Sorry to be a pain - I really need to understand the issue and how to reliably and as easily as possible reproduce it in order to understand how to solve.

  • 🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)

    We are adding @ as delimiters around text which a filter should process. As it happens, that filter is turning the delimited text into a link.

    When our delimited text is added inside <foonotes> tags, our problem clears up. The text delimited by @...@ is converted to a link by our custom filter.

    When adding the same text inside the data-text attribute, the @...@ are simply printed to output, and not processed by the filter.

    We could use different characters as delimiters, and update all legacy content. I have notg tested using other delimiters.

  • 🇬🇧United Kingdom scott_euser

    When our delimited text is added inside tags, our problem clears up. The text delimited by @...@ is converted to a link by our custom filter.

    So should this issue be closed then?

    When our delimited text is added inside <foonotes> tags, our problem clears up. The text delimited by @...@ is converted to a link by our custom filter.

    You could change your custom filter to run earlier. Whether the custom filter runs on a data attribute or not of course depends on your custom filter.

  • Status changed to Closed: cannot reproduce 12 months ago
Production build 0.71.5 2024