Keep elements with 'footnote' as possible candidates

Should fix https://github.com/wallabag/wallabag/issues/3100

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
Kevin Decherf
2017-11-01 16:45:07 +01:00
parent 276684ab6d
commit 4c68cc9f09
3 changed files with 69 additions and 1 deletions
+14
View File
@@ -479,4 +479,18 @@ class ReadabilityTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($res);
}
public function testKeepFootnotes()
{
// from https://www.schreibdichte.de/blog/feed-aggregator-und-spaeter-lesen-dienst-im-team
$html = file_get_contents('tests/fixtures/keepFootnotes.html');
$readability = $this->getReadability($html, 'http://0.0.0.0');
$readability->debug = true;
$res = $readability->init();
$this->assertTrue($res);
$this->assertContains('<sup id="fnref1:fnfeed_2"><a href="#fn:fnfeed_2" class="footnote-ref">2</a></sup>', $readability->getContent()->innerHTML);
$this->assertContains('<a href="#fnref1:fnfeed_2" rev="footnote"', $readability->getContent()->innerHTML);
}
}