Issue #3614677 by pbabin, sriram_s: Do not repeat noreferrer in rel on external links wrapping an image
Guard the noreferrer append with an existence check, matching the nofollow block above it.
Links wrapping an image never receive data-extlink (applyClassAndSpan() filters them while extlink_img_class is off, the default), so they keep matching a:not([data-extlink]) and get reprocessed on every behaviour pass, appending noreferrer each time.
Extends testExtlinkNoreferrerExclusion() with an image-wrapping link rather than adding a separate method: red on current 2.0.x, green with the fix. Verified locally on Drupal 11.4.4, full suite 31 tests / 476 assertions with no failures, phpcs and phpstan clean.
AI-Generated: Yes. Claude was used to help trace the cause and draft the test and this description; the reproduction and all test runs were verified locally.
Closes #3614677