Subject: | Removes newline after linktag |
I'm using HTML::Clean and I find it useful for reducing the size of HTML
downloads. However, I do have a small problem with it. If I have the
following text:
<a href="http://www.yahoo.com">Yahoo</a>
<font size=-1>(link to yahoo)</font>
It gets transformed to something like
<a href="http://www.yahoo.com">Yahoo</a><font size=-1>(link to yahoo)</font>
It gets displayed as Yahoo(link to yahoo)
But instead I want it to be transformed to
<a href="http://www.yahoo.com">Yahoo</a> <font size=-1>(link to yahoo)</font>
With a *space* between the "Yahoo" link and the "(link to
yahoo)" text. That is, Yahoo (link to yahoo)
I was able to fix it easily so that it puts a space between tags. Please see the attached patch.
--- Clean.pm.old Wed Jan 17 06:01:37 2001
+++ Clean.pm Wed Jan 17 06:01:45 2001
@@ -431,7 +431,7 @@
$$h =~ s,\n\s+<,\n<,sg; # space before tag
$$h =~ s,\n\s+,\n ,sg; # other spaces
- $$h =~ s,>\n\s*<,><,sg; # LF/spaces between tags..
+ $$h =~ s,>\n\s*<,> <,sg; # LF/spaces between tags..
# Remove excess spaces within tags.. note, we could parse out the elements
# and rewrite for excess spaces between elements. perhaps next version.