Fix javascript typo

And add coverage
This commit is contained in:
Jeremy Benoist
2015-04-29 10:24:20 +02:00
parent ddd013e3f8
commit f5d473780d
3 changed files with 9 additions and 3 deletions
+2
View File
@@ -1 +1,3 @@
vendor/
coverage/
composer.lock
+4 -1
View File
@@ -19,11 +19,14 @@
<filter>
<whitelist>
<directory>./src/TubeLink/</directory>
<directory>./src/</directory>
<exclude>
<directory>./tests</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="coverage" title="FullText" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/>
</logging>
</phpunit>
+3 -2
View File
@@ -52,6 +52,7 @@ class Readability
public $revertForcedParagraphElements = true;
public $articleTitle;
public $articleContent;
public $original_html;
public $dom;
public $url = null; // optional - URL where HTML was retrieved
public $lightClean = true; // preserves more content (experimental)
@@ -179,7 +180,7 @@ class Readability
$this->debugText .= 'Tidying document'."\n";
$tidy = tidy_parse_string($html, $this->tidy_config, 'UTF8');
if (tidy_clean_repair($tidy)) {
$original_html = $html;
$this->original_html = $html;
$this->tidied = true;
$html = $tidy->value;
$html = preg_replace('/<html[^>]+>/i', '<html>', $html);
@@ -258,7 +259,7 @@ class Readability
if ($this->bodyCache == null) {
$this->bodyCache = '';
foreach ($bodyElems as $bodyNode) {
$this->bodyCache += $bodyNode->innerHTML;
$this->bodyCache .= trim($bodyNode->innerHTML);
}
}
if ($bodyElems->length > 0 && $this->body == null) {