mirror of https://github.com/wallabag/wallabag.git
better entry txt export using html2text
This commit is contained in:
parent
2490f61dca
commit
c660878388
|
@ -84,7 +84,8 @@
|
|||
"symfony/dom-crawler": "^3.1",
|
||||
"friendsofsymfony/jsrouting-bundle": "^1.6",
|
||||
"bdunogier/guzzle-site-authenticator": "^1.0.0@dev",
|
||||
"defuse/php-encryption": "^2.1"
|
||||
"defuse/php-encryption": "^2.1",
|
||||
"html2text/html2text": "^4.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/doctrine-fixtures-bundle": "~2.2",
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Wallabag\CoreBundle\Helper;
|
||||
|
||||
use Html2Text\Html2Text;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use JMS\Serializer\SerializerBuilder;
|
||||
use PHPePub\Core\EPub;
|
||||
|
@ -408,7 +409,8 @@ class EntriesExport
|
|||
$bar = str_repeat('=', 100);
|
||||
foreach ($this->entries as $entry) {
|
||||
$content .= "\n\n" . $bar . "\n\n" . $entry->getTitle() . "\n\n" . $bar . "\n\n";
|
||||
$content .= trim(preg_replace('/\s+/S', ' ', strip_tags($entry->getContent()))) . "\n\n";
|
||||
$html = new Html2Text($entry->getContent(), ['do_links' => 'none', 'width' => 100]);
|
||||
$content .= $html->getText();
|
||||
}
|
||||
|
||||
return Response::create(
|
||||
|
|
Loading…
Reference in New Issue