mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-30 21:30:14 +02:00
all: Use ->remove() instead of ->outertext = ''
simplehtmldom 1.9 introduced new functions to recursively remove nodes from the DOM. This allows removing elements without the need to re-load the document by using $html->load($html->save()), which is very inefficient. Find more information about remove() at https://simplehtmldom.sourceforge.io/docs/1.9/api/simple_html_dom_node/remove/
This commit is contained in:
@@ -48,7 +48,7 @@ class SIMARBridge extends BridgeAbstract {
|
||||
foreach($e_item->find('p') as $paragraph) {
|
||||
/* Remove empty paragraphs */
|
||||
if (preg_match('/^(\W| )+$/', $paragraph->innertext) == 1) {
|
||||
$paragraph->outertext = '';
|
||||
$paragraph->remove();
|
||||
}
|
||||
}
|
||||
if ($e_item) {
|
||||
|
Reference in New Issue
Block a user