mirror of
https://github.com/j0k3r/php-readability.git
synced 2026-09-27 06:26:17 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91b80b70e2 | ||
|
|
8667dae74b | ||
|
|
eecae93161 | ||
|
|
814c6e4730 |
+4
-2
@@ -1,18 +1,20 @@
|
|||||||
language: php
|
language: php
|
||||||
|
|
||||||
php:
|
php:
|
||||||
|
- 5.3.3
|
||||||
|
- 5.3
|
||||||
- 5.4
|
- 5.4
|
||||||
- 5.5
|
- 5.5
|
||||||
- 5.6
|
- 5.6
|
||||||
- nightly
|
- nightly
|
||||||
- hhvm-nightly
|
- hhvm
|
||||||
|
|
||||||
# run build against nightly but allow them to fail
|
# run build against nightly but allow them to fail
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- php: nightly
|
- php: nightly
|
||||||
- php: hhvm-nightly
|
- php: hhvm
|
||||||
|
|
||||||
# faster builds on new travis setup not using sudo
|
# faster builds on new travis setup not using sudo
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@
|
|||||||
"role": "Developer (original JS version)"
|
"role": "Developer (original JS version)"
|
||||||
}],
|
}],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.4",
|
"php": ">=5.3.3",
|
||||||
"ext-tidy": ">=1.2"
|
"ext-tidy": ">=1.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|||||||
+1
-1
@@ -27,6 +27,6 @@
|
|||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
<logging>
|
<logging>
|
||||||
<log type="coverage-html" target="coverage" title="FullText" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/>
|
<log type="coverage-html" target="coverage" title="Readability" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/>
|
||||||
</logging>
|
</logging>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
+10
-5
@@ -47,7 +47,6 @@ namespace Readability;
|
|||||||
*/
|
*/
|
||||||
class Readability
|
class Readability
|
||||||
{
|
{
|
||||||
public $version = '1.7.2-without-multi-page';
|
|
||||||
public $convertLinksToFootnotes = false;
|
public $convertLinksToFootnotes = false;
|
||||||
public $revertForcedParagraphElements = true;
|
public $revertForcedParagraphElements = true;
|
||||||
public $articleTitle;
|
public $articleTitle;
|
||||||
@@ -89,9 +88,9 @@ class Readability
|
|||||||
'output-xhtml' => true,
|
'output-xhtml' => true,
|
||||||
'logical-emphasis' => true,
|
'logical-emphasis' => true,
|
||||||
'show-body-only' => false,
|
'show-body-only' => false,
|
||||||
'new-blocklevel-tags' => 'article,aside,audio,details,figcaption,figure,footer,header,hgroup,nav,section,source,summary,temp,track,video',
|
'new-blocklevel-tags' => 'article aside audio bdi canvas details dialog figcaption figure footer header hgroup main menu menuitem nav section source summary template track video',
|
||||||
'new-empty-tags' => 'command,embed,keygen,source,track,wbr',
|
'new-empty-tags' => 'command embed keygen source track wbr',
|
||||||
'new-inline-tags' => 'audio,canvas,command,datalist,embed,keygen,mark,meter,output,progress,time,video,wbr',
|
'new-inline-tags' => 'audio command datalist embed keygen mark menuitem meter output progress source time video wbr',
|
||||||
'wrap' => 0,
|
'wrap' => 0,
|
||||||
'drop-empty-paras' => true,
|
'drop-empty-paras' => true,
|
||||||
'drop-proprietary-attributes' => false,
|
'drop-proprietary-attributes' => false,
|
||||||
@@ -195,7 +194,13 @@ class Readability
|
|||||||
libxml_use_internal_errors(true);
|
libxml_use_internal_errors(true);
|
||||||
$this->dom = new \DOMDocument();
|
$this->dom = new \DOMDocument();
|
||||||
$this->dom->preserveWhiteSpace = false;
|
$this->dom->preserveWhiteSpace = false;
|
||||||
@$this->dom->loadHTML($html, LIBXML_NOBLANKS | LIBXML_COMPACT | LIBXML_NOERROR);
|
|
||||||
|
if (PHP_VERSION_ID >= 50400) {
|
||||||
|
$this->dom->loadHTML($html, LIBXML_NOBLANKS | LIBXML_COMPACT | LIBXML_NOERROR);
|
||||||
|
} else {
|
||||||
|
$this->dom->loadHTML($html);
|
||||||
|
}
|
||||||
|
|
||||||
libxml_use_internal_errors(false);
|
libxml_use_internal_errors(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user