1
0
mirror of https://tt-rss.org/git/tt-rss.git synced 2024-06-26 11:59:02 +02:00

sanitize_rss: only insert linebreak after first img

This commit is contained in:
Andrew Dolgov 2010-11-13 00:24:15 +03:00
parent fbc95c5b70
commit 3f770c8778

View File

@ -3748,6 +3748,7 @@
$xpath = new DOMXPath($doc);
$entries = $xpath->query('(//a[@href]|//img[@src])');
$br_inserted = 0;
foreach ($entries as $entry) {
@ -3768,11 +3769,13 @@
}
}
if (strtolower($entry->nodeName) == "img") {
if (strtolower($entry->nodeName) == "img" && !$br_inserted) {
$br = $doc->createElement("br");
if ($entry->parentNode->nextSibling)
if ($entry->parentNode->nextSibling) {
$entry->parentNode->insertBefore($br, $entry->nextSibling);
$br_inserted = 1;
}
}
}