Fixed embedded image mismatching when 'src' is not the first 'img' tag attribute

This commit is contained in:
Brian Ó Donnell
2015-12-30 11:03:36 -05:00
parent 5e83ea6935
commit 9fc84933a7
+2 -2
View File
@@ -290,7 +290,7 @@ sub get_feed_items {
# extract image link and hover text from content:encoded if it exists
if( defined $item->{'content:encoded'} ){
$item->{'content:encoded'} =~ /img src=\\?'(https?:\/\/[^']+)/ unless $item->{'content:encoded'} =~ /img src=\\?"(https?:\/\/[^"]+)/;
$item->{'content:encoded'} =~ /img .* src=\\?'(https?:\/\/[^']+)/ unless $item->{'content:encoded'} =~ /img .* src=\\?"(https?:\/\/[^"]+)/;
if( defined $1 ){
$image = $1;
@@ -301,7 +301,7 @@ sub get_feed_items {
# extract image link and hover text from description if it exists
if( not length $image and defined $item->{'description'} ){
$item->{'description'} =~ /img src='(https?:\/\/[^']+)/ unless $item->{'description'} =~ /img src="(https?:\/\/[^"]+)/;
$item->{'description'} =~ /img .* src='(https?:\/\/[^']+)/ unless $item->{'description'} =~ /img .* src="(https?:\/\/[^"]+)/;
if( defined $1 ){
$image = $1;