Fix javascript typo

And add coverage
pull/3/head
Jeremy Benoist 11 years ago
parent ddd013e3f8
commit f5d473780d
  1. 2
      .gitignore
  2. 5
      phpunit.xml.dist
  3. 5
      src/Readability.php

2
.gitignore vendored

@ -1 +1,3 @@
vendor/ vendor/
coverage/
composer.lock

@ -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>

@ -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) {

Loading…
Cancel
Save