<excludeFolder url="file://$MODULE_DIR$/vendor/clue/stream-filter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/coderello/laravel-nova-lang" />
<excludeFolder url="file://$MODULE_DIR$/vendor/dompdf/dompdf" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/html2text/html2text" />
<excludeFolder url="file://$MODULE_DIR$/vendor/http-interop/http-factory-guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/itsgoingd/clockwork" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jean85/pretty-package-versions" />
<path value="$PROJECT_DIR$/vendor/maennchen/zipstream-php" />
<path value="$PROJECT_DIR$/vendor/masterminds/html5" />
<path value="$PROJECT_DIR$/vendor/judev/php-htmltruncator" />
+ <path value="$PROJECT_DIR$/vendor/html2text/html2text" />
</include_path>
</component>
<component name="PhpInterpreters">
{
return [
'title' => $this->getMetaTitle(),
- 'description' => strip_tags($this->getMetaDescription()),
+ 'description' => $this->getCleanMetaDescription(),
'image' => $this->getMetaImage(),
'url' => $this->getMetaUrl(),
];
return $this->title;
}
+ /**
+ * @return string
+ */
+ final protected function getCleanMetaDescription(): string
+ {
+ $str = (new \Html2Text\Html2Text($this->getMetaDescription()))->getText();
+ return preg_replace("/\r\n|\r|\n/", ' ', $str);
+ }
+
protected function getMetaDescription(): string
{
return $this->chapo;
];
+
public function getPreviewAttribute(): string
{
- $line = strip_tags($this->content);
+ $line = (new \Html2Text\Html2Text($this->content))->getText();
if (preg_match('/^.{1,200}\b/s', $line, $match)) {
$line = trim($match[0]) . "…";
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
+ "html2text/html2text": "^4.3",
"itsgoingd/clockwork": "^4.1",
"judev/php-htmltruncator": "^1.2",
"kriswallsmith/buzz": "^1.1",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "70d746984d1fe596d469cdd574622e82",
+ "content-hash": "3a16aca0cab60a6ab491bc8a8516253e",
"packages": [
{
"name": "algolia/algoliasearch-client-php",
],
"time": "2019-07-01T23:21:34+00:00"
},
+ {
+ "name": "html2text/html2text",
+ "version": "4.3.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/mtibben/html2text.git",
+ "reference": "61ad68e934066a6f8df29a3d23a6460536d0855c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/mtibben/html2text/zipball/61ad68e934066a6f8df29a3d23a6460536d0855c",
+ "reference": "61ad68e934066a6f8df29a3d23a6460536d0855c",
+ "shasum": ""
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance",
+ "symfony/polyfill-mbstring": "If you can't install ext-mbstring"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Html2Text\\": [
+ "src/",
+ "test/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "description": "Converts HTML to formatted plain text",
+ "time": "2020-04-16T23:44:31+00:00"
+ },
{
"name": "http-interop/http-factory-guzzle",
"version": "1.0.0",