You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The footnote/ref_id_prefix and footnote/footnote_id_prefix configuration options are only used to generate element id attributes, but are ignored for the href attributes corresponding to those IDs, breaking all footnote reference links and backlinks if either config option is customized.
The default values for these configuration options, fnref: and fn:, are hard-coded in 5 places:
Instead of hard-coding these values, we can update those 5 references to them to check the config. I'm not sure how involved this would be since it looks to me like none of those classes currently have access to the config at all.
But also, since these attributes are completely hidden from end users and don't affect styling, it occurred to me that they don't necessarily need to be customizable? An easier solution would be to hard-code them everywhere and not allow them to be overriden at all.
Thoughts? Either way, I'll try to get a PR in to fix this in the next week or two!
The text was updated successfully, but these errors were encountered:
But also, since these attributes are completely hidden from end users and don't affect styling, it occurred to me that they don't necessarily need to be customizable? An easier solution would be to hard-code them everywhere and not allow them to be overriden at all.
Logically, it makes sense to fix said Drupal core bug (and I'm sure it will one day... a Drupal bug half-life varies wildly), but practically, there could be any number of reasons why these identifiers may need to be configurable (maybe integration with a custom SPA app/3rd-party JS library of some kind).
Version(s) affected: 1.5.x
Description
The
footnote/ref_id_prefix
andfootnote/footnote_id_prefix
configuration options are only used to generate elementid
attributes, but are ignored for thehref
attributes corresponding to those IDs, breaking all footnote reference links and backlinks if either config option is customized.The default values for these configuration options,
fnref:
andfn:
, are hard-coded in 5 places:commonmark/src/Extension/Footnote/Event/GatherFootnotesListener.php
Line 52 in d9fdf5f
commonmark/src/Extension/Footnote/Event/GatherFootnotesListener.php
Line 95 in d9fdf5f
commonmark/src/Extension/Footnote/Event/AnonymousFootnotesListener.php
Line 46 in d9fdf5f
commonmark/src/Extension/Footnote/Parser/AnonymousFootnoteRefParser.php
Line 80 in d9fdf5f
commonmark/src/Extension/Footnote/Parser/FootnoteRefParser.php
Line 59 in d9fdf5f
How to reproduce
Config:
Markdown:
Expected HTML:
Actual HTML:
Possible Solution
Instead of hard-coding these values, we can update those 5 references to them to check the config. I'm not sure how involved this would be since it looks to me like none of those classes currently have access to the config at all.
But also, since these attributes are completely hidden from end users and don't affect styling, it occurred to me that they don't necessarily need to be customizable? An easier solution would be to hard-code them everywhere and not allow them to be overriden at all.
Thoughts? Either way, I'll try to get a PR in to fix this in the next week or two!
The text was updated successfully, but these errors were encountered: