diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-05-16 23:11:20 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-05-31 14:00:15 +0200 |
commit | 0d6cfb884c8ef75e4dc5fd667fb9d29702523a2a (patch) | |
tree | 7a6b882ce812fdea3de5675e3bcad185727dfe6c /src/Wallabag | |
parent | cf05a1ae342b8f59ee0944eeba0f75aa0a1a2816 (diff) | |
download | wallabag-0d6cfb884c8ef75e4dc5fd667fb9d29702523a2a.tar.gz wallabag-0d6cfb884c8ef75e4dc5fd667fb9d29702523a2a.tar.zst wallabag-0d6cfb884c8ef75e4dc5fd667fb9d29702523a2a.zip |
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.
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/ContentProxy.php | 19 |
1 files changed, 1 insertions, 18 deletions
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 | |||
47 | { | 47 | { |
48 | // ensure content is a bit cleaned up | 48 | // ensure content is a bit cleaned up |
49 | if (!empty($content['html'])) { | 49 | if (!empty($content['html'])) { |
50 | $extractor = $this->graby->getExtractor(); | 50 | $content['html'] = $this->graby->cleanupHtml($content['html'], $url); |
51 | $contentExtracted = $extractor->process($content['html'], $url); | ||
52 | |||
53 | if ($contentExtracted) { | ||
54 | $contentBlock = $extractor->getContent(); | ||
55 | $contentBlock->normalize(); | ||
56 | |||
57 | $content['html'] = trim($contentBlock->innerHTML); | ||
58 | } | ||
59 | |||
60 | $content['html'] = htmLawed($content['html'], [ | ||
61 | 'safe' => 1, | ||
62 | // which means: do not remove iframe elements | ||
63 | 'elements' => '*+iframe', | ||
64 | 'deny_attribute' => 'style', | ||
65 | 'comment' => 1, | ||
66 | 'cdata' => 1, | ||
67 | ]); | ||
68 | } | 51 | } |
69 | 52 | ||
70 | // do we have to fetch the content or the provided one is ok? | 53 | // do we have to fetch the content or the provided one is ok? |