Skip to content

Commit

Permalink
Remove duplicate tidy cleanup
Browse files Browse the repository at this point in the history
And update deps
  • Loading branch information
j0k3r committed Aug 19, 2015
1 parent a22b532 commit 93f2817
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 51 deletions.
48 changes: 28 additions & 20 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 2 additions & 31 deletions src/FeedBundle/Parser/Internal.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use TubeLink\TubeLink;
use TubeLink\Exception\ServiceNotFoundException;
use Api43\FeedBundle\Readability\ReadabilityExtended;
use Readability\Readability;

/**
* Retrieve content from an internal library instead of a webservice.
Expand Down Expand Up @@ -83,37 +84,7 @@ public function parse($url)
return '';
}

$tidyConfig = array(
'tidy-mark' => false,
'vertical-space' => false,
'doctype' => 'omit',
'numeric-entities' => false,
// 'preserve-entities' => true,
'break-before-br' => false,
'clean' => true,
'output-xhtml' => true,
'logical-emphasis' => true,
'show-body-only' => false,
'new-blocklevel-tags' => 'article aside audio details dialog figcaption figure footer header hgroup nav section source summary temp track video',
'new-empty-tags' => 'command embed keygen source track wbr',
'new-inline-tags' => 'audio canvas command data datalist embed keygen mark meter output progress time video wbr',
'wrap' => 0,
'drop-empty-paras' => true,
'drop-proprietary-attributes' => true,
'enclose-text' => true,
'enclose-block-text' => true,
'merge-divs' => true,
'merge-spans' => true,
// 'input-encoding' => '????',
'output-encoding' => 'utf8',
'hide-comments' => true,
);

// let's clean up input.
$tidy = tidy_parse_string($content, $tidyConfig, 'UTF8');
$tidy->cleanRepair();

$readability = new ReadabilityExtended($tidy->value, $url);
$readability = new ReadabilityExtended($content, $url);
// $readability->debug = true;
$readability->regexps = $this->regexps;
$readability->convertLinksToFootnotes = false;
Expand Down

0 comments on commit 93f2817

Please sign in to comment.