Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The external link icon will not show up for any of the external links on the page when any given anchor ID is exactly 'module'.
To reproduce, try the following:
<h2 id="foo">Title 1</h2>
<p>A <a href="https://www.drupal.org/project/extlink">link</a>.</p>
<h2 id="bar">Title 2</h2>
<p>Another <a href="https://www.drupal.org/node/131949/commits">link</a>.</p>
<h2 id="module">Title 3</h2>
<p>One last <a href="https://www.drupal.org/node/2834289">link</a>.</p>
Proposed resolution
TBD.
Remaining tasks
Understand why this particular string is causing the module to fail to display the icon next to all links on the page.
User interface changes
The expected external link icon should now appear on all pages, even those with 'module' as an anchor ID
API changes
None.
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#13 | 2834289-13.patch | 2.52 KB | elachlan |
#11 | 2834289-11.patch | 1.55 KB | elachlan |
#9 | 2834289-9.patch | 1.94 KB | elachlan |
#7 | 2834289-1.patch | 1.97 KB | elachlan |
Comments
Comment #2
anavarreComment #3
elachlan CreditAttribution: elachlan commentedCan you see anything in the code that might relate to this? I can't see anything targeting elements with an id of 'module'.
Comment #4
yoruvo CreditAttribution: yoruvo commentedThe difference I see between these three links is that the first two are HTTPS, the last is HTTP. Might your issue be related to that, instead?
Comment #5
anavarreComment #6
anavarre@ivi.arocom - I've clarified the issue summary to have only HTTPS links and prevent any confusion. You can try with the sample code to reproduce the issue. I was able to do so just now. Add the first two links and it works immediately. Add the last one with 'module' as the anchor and it fails to display extlink immediately for all links on the page.
Comment #7
elachlan CreditAttribution: elachlan commentedComment #9
elachlan CreditAttribution: elachlan commentedComment #11
elachlan CreditAttribution: elachlan commentedComment #13
elachlan CreditAttribution: elachlan commentedComment #15
elachlan CreditAttribution: elachlan commentedOK. The functional test is displaying the problem. But I think the error is in Drupal Core? It is the one causing the javascript error.
Do you agree?
Comment #16
elachlan CreditAttribution: elachlan commentedComment #17
elachlan CreditAttribution: elachlan commentedThe issue is in the domready library used by drupal 8.
I have filed an issue at https://github.com/ded/domready/issues/57
Please track the progress there, or at #2961308: All JavaScript breaks if an HTML id="module" is in the markup (domready library bug).