Subject: | Link beginning with newline |
Hi there:
I'm forwarding this on behalf of a Debian user, who has provided the
attached foo.pl for your perusal. The original text of the bug (which
follows) can be found at:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=442804
Running "perl foo.pl" on the program below prints
http://foo.org/
http://foo.org/bar.html
where I hoped it would give the second line only.
The link in the item starts with a newline, and I suspect the munging
within rsslite has decided it's text or something so the feed link
should be added. The way rsslite fixes up fields is a good thing, but
in this case I think the fix should be to strip leading whitespace.
I don't know if leading whitespace is valid rss, I saw it in a feed
http://www.coastalwatch.com/rss/cwreports_330.xml
Subject: | foo.pl |
use strict;
use XML::RSSLite;
my %feed;
my $xml = '<?xml version="1.0"?>
<rss version="2.0">
<channel>
<link>http://foo.org</link>
<item>
<link>
http://foo.org/bar.html</link>
</item>
</channel>
</rss>
';
parseRSS(\%feed, \$xml);
print $feed{'item'}->{'link'};