Closed (fixed)
Project:
Printer, email and PDF versions
Version:
7.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Oct 2005 at 23:19 UTC
Updated:
27 Aug 2007 at 11:51 UTC
My print friendly pages appear to have an open 'a' tag around images which have been inserted using img_assist. So, the code is something like this:
<a ><u><img width="250" height="255" alt="image" src="/files/images/image.jpg" /></u> [1]
I am not sure if this is a problem with the print.module or the img_assist.module.
For an example, go to:
http://www.stnina.org/node/25/print
and take a look at the code.
Any ideas?
Thanks,
Maria
Comments
Comment #1
deekayen commentedI'm guessing it's not img_assist, since with today's CVS version of print and Drupal 4.7, file attachments have the same open
atag.Comment #2
deekayen commentedThis was my fix. I think this is probably a bug in core, but even if it gets fixed later, the
str_replaceshould be harmless (unless for some reason people actually want<a <u>in their node).It's committed to CVS for Drupal 4.7 (but not tagged for 4.7 packaging). Needs backport for older versions.
Comment #3
deekayen commentedComment #4
deekayen commentedOn second review, I don't think a
str_replacewill do the whole job. Though I haven't verfied it, according to the preg_replace pattern in the source,<a target="_blank" href="...would produce<a target="_blank" <u>after replacement. It's probably going to need a fancier replacement expression or another one to cleanup after the first.Comment #5
deekayen commentedThis appears to work as a new pattern for
print_generate_node():Comment #6
deekayen commentedThis breaks the regex for properly counting URLs in HREF values, but I don't think I can really spend the time to make a regex to prevent it from breaking the link counter:
Comment #7
deekayen commentedI committed the
<a.*?part of the pattern to replace the str_replace solution. I'll leave this open as a minor issue for figuring out the previous post's breakage example.Comment #8
deekayen commentedComment #9
deekayen commentedcommitted the
<a.*?to DRUPAL-4-6Comment #10
jcnventuradeekayen had mostly fixed the problem, but to solve the problem that he pointed out earlier, I re-wrote the tag parsing mechanism so that only href or src elements are handled. This is now in the latest 5.x dev release.