mirror of
https://github.com/j0k3r/php-readability.git
synced 2026-09-27 06:26:17 +00:00
Fix javascript typo
And add coverage
This commit is contained in:
@@ -1 +1,3 @@
|
|||||||
vendor/
|
vendor/
|
||||||
|
coverage/
|
||||||
|
composer.lock
|
||||||
|
|||||||
+4
-1
@@ -19,11 +19,14 @@
|
|||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<whitelist>
|
<whitelist>
|
||||||
<directory>./src/TubeLink/</directory>
|
<directory>./src/</directory>
|
||||||
<exclude>
|
<exclude>
|
||||||
<directory>./tests</directory>
|
<directory>./tests</directory>
|
||||||
</exclude>
|
</exclude>
|
||||||
</whitelist>
|
</whitelist>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
|
<logging>
|
||||||
|
<log type="coverage-html" target="coverage" title="FullText" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/>
|
||||||
|
</logging>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
+3
-2
@@ -52,6 +52,7 @@ class Readability
|
|||||||
public $revertForcedParagraphElements = true;
|
public $revertForcedParagraphElements = true;
|
||||||
public $articleTitle;
|
public $articleTitle;
|
||||||
public $articleContent;
|
public $articleContent;
|
||||||
|
public $original_html;
|
||||||
public $dom;
|
public $dom;
|
||||||
public $url = null; // optional - URL where HTML was retrieved
|
public $url = null; // optional - URL where HTML was retrieved
|
||||||
public $lightClean = true; // preserves more content (experimental)
|
public $lightClean = true; // preserves more content (experimental)
|
||||||
@@ -179,7 +180,7 @@ class Readability
|
|||||||
$this->debugText .= 'Tidying document'."\n";
|
$this->debugText .= 'Tidying document'."\n";
|
||||||
$tidy = tidy_parse_string($html, $this->tidy_config, 'UTF8');
|
$tidy = tidy_parse_string($html, $this->tidy_config, 'UTF8');
|
||||||
if (tidy_clean_repair($tidy)) {
|
if (tidy_clean_repair($tidy)) {
|
||||||
$original_html = $html;
|
$this->original_html = $html;
|
||||||
$this->tidied = true;
|
$this->tidied = true;
|
||||||
$html = $tidy->value;
|
$html = $tidy->value;
|
||||||
$html = preg_replace('/<html[^>]+>/i', '<html>', $html);
|
$html = preg_replace('/<html[^>]+>/i', '<html>', $html);
|
||||||
@@ -258,7 +259,7 @@ class Readability
|
|||||||
if ($this->bodyCache == null) {
|
if ($this->bodyCache == null) {
|
||||||
$this->bodyCache = '';
|
$this->bodyCache = '';
|
||||||
foreach ($bodyElems as $bodyNode) {
|
foreach ($bodyElems as $bodyNode) {
|
||||||
$this->bodyCache += $bodyNode->innerHTML;
|
$this->bodyCache .= trim($bodyNode->innerHTML);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($bodyElems->length > 0 && $this->body == null) {
|
if ($bodyElems->length > 0 && $this->body == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user