I've posted about this before, but received no help. I've read around, asked others, and still find myself stumped, so I'm trying here again. Maybe my savior didn't see the thread before...
I'm finishing off a function that will find <blockquote /> and <q /> elements with the cite attribute defined, and use that URI to construct a link to the quotation source. The blockquote section is working beautifully.
For quotes, I want to use the existing quote text and basically turn that into the link. To do so, I am looping over the child nodes of a <q />, saving those text values into a temporary container that is then appended to the new <a /> which is in turn appended to the <q />.
The problem is with <img /> elements for some reason. As you can see on the test page, if there is a mix of text nodes and <img /> element nodes, my script fails to grab the alt attribute of the <img />. Through some alerting, I've determined that in that instance, the script sees the proper amount of nodes, but just ignores the <img /> for some reason. If there quote contains nothing more than an <img />, the script works as intended.