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.
This is very similar to [#10165], but I'm seeing it in Drupal 7. I looked at the patch offered in [#10165], but the gotwo.module is pretty different for Drupal 7.
See http://drupal.org/node/101605
My "gotwo" link is:
<go href="http://rickumali.com"><img src="http://www.beginnericehockey.com/sites/default/files/hockey-logo-sm.gif"></go>
I'm willing to take up the fix, but if someone could corroborate this, or tell me what I'm doing wrong, that'd be great. Thank you!
Comments
Comment #1
rickumali CreditAttribution: rickumali commentedMy description was messed up. I meant to write that this is similar to #101605: <img> inside <go> appears to break it.. Thank you!
Comment #2
rickumali CreditAttribution: rickumali commentedI have a fix that seems to work for me, but I'd love a code review of sorts. The diff is:
Basically, when
<go>
contains an<img>
, the goNode->nodeValue is an empty string (or at least, it acts empty). This is because the nodeValue is not a TEXT_NODE, but rather an ELEMENT_NODE. The proposed fix creates the element 'a' as the linkNode, and then appends the first child into it. Big assumption is that will contain ONE CHILD. The fix could be made more defensive. Please advise on checking in and what not.Comment #3
Summit CreditAttribution: Summit commentedSubscribing, greetings, Martijn
Comment #4
hass CreditAttribution: hass commentedMaybe we are able to clone all stuff inside an A tag... I cannot remember why or if I have tested the IMG inside an A tag. We should write a .test to prevent future failures.
Comment #5
hass CreditAttribution: hass commentedCommitted a fix (http://drupalcode.org/project/gotwo.git/commit/72b7e1e) that clones all child nodes and not only the first child.
Please give next DEV a try an report back if it works for you. We still need to write tests for this...