From 0d6cfb884c8ef75e4dc5fd667fb9d29702523a2a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 16 May 2017 23:11:20 +0200 Subject: Remove htmlawed and use graby instead Instead of using htmlawed (which is already used in graby) use graby directly (which require some refacto on graby side). Still needs some tests. --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index a1df16d8..66d72fe6 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -47,24 +47,7 @@ class ContentProxy { // ensure content is a bit cleaned up if (!empty($content['html'])) { - $extractor = $this->graby->getExtractor(); - $contentExtracted = $extractor->process($content['html'], $url); - - if ($contentExtracted) { - $contentBlock = $extractor->getContent(); - $contentBlock->normalize(); - - $content['html'] = trim($contentBlock->innerHTML); - } - - $content['html'] = htmLawed($content['html'], [ - 'safe' => 1, - // which means: do not remove iframe elements - 'elements' => '*+iframe', - 'deny_attribute' => 'style', - 'comment' => 1, - 'cdata' => 1, - ]); + $content['html'] = $this->graby->cleanupHtml($content['html'], $url); } // do we have to fetch the content or the provided one is ok? -- cgit v1.2.3