mirror of
https://github.com/j0k3r/php-readability.git
synced 2026-09-27 06:26:17 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user