Revert "all: Use ->remove() instead of ->outertext = ''"

This reverts commit 052844f5e1.

There is a bug in ->remove() that causes the parser to incorrectly
identify elements in the DOM tree that shouldn't exist anymore.

References #1151
This commit is contained in:
logmanoriginal 2019-06-02 13:03:26 +02:00
parent 468d8be72d
commit 6c4098d655
21 changed files with 49 additions and 44 deletions

View file

@ -239,16 +239,16 @@ class JustETFBridge extends BridgeAbstract {
or returnServerError('Article body not found!');
// Remove teaser image
$element->find('img.teaser-img', 0)->remove();
$element->find('img.teaser-img', 0)->outertext = '';
// Remove self advertisements
foreach($element->find('.call-action') as $adv) {
$adv->remove();
$adv->outertext = '';
}
// Remove tips
foreach($element->find('.panel-edu') as $tip) {
$tip->remove();
$tip->outertext = '';
}
// Remove inline scripts (used for i.e. interactive graphs) as they are
@ -318,7 +318,7 @@ class JustETFBridge extends BridgeAbstract {
$description = $description->parent();
foreach($description->find('div') as $div) {
$div->remove();
$div->outertext = '';
}
$quote = $html->find('div.infobox div.val', 0)