mirror of
https://github.com/friendica/friendica
synced 2025-04-28 02:30:16 +00:00
Support for non HTML content for feed imports
This commit is contained in:
parent
ee9510e17d
commit
bca86beda0
2 changed files with 22 additions and 3 deletions
|
@ -29,7 +29,6 @@ use Friendica\Contact\LocalRelationship\Entity\LocalRelationship;
|
|||
use Friendica\Content\PageInfo;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\Core\Cache\Enum\Duration;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Worker;
|
||||
|
@ -546,6 +545,13 @@ class Feed
|
|||
if (self::titleIsBody($item['title'], $body)) {
|
||||
$item['title'] = '';
|
||||
}
|
||||
|
||||
if (!HTML::isHTML($body)) {
|
||||
$original = $body;
|
||||
$body = BBCode::convert($body, false, BBCode::EXTERNAL);
|
||||
Logger::debug('Body contained no HTML', ['original' => $original, 'converted' => $body]);
|
||||
}
|
||||
|
||||
$item['body'] = HTML::toBBCode($body, $basepath);
|
||||
|
||||
// Remove tracking pixels
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue