mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 12:34:39 +02:00
Merge pull request #14908 from randompenguin1/develop
Some checks are pending
Code Quality / PHP-CS-Fixer (PHP 8.3) (push) Waiting to run
Code Quality / PHPStan (PHP 8.4) (push) Waiting to run
Code Quality / PHPStan in addons (PHP 8.4) (push) Waiting to run
Code Quality / PHPMD (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 7.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.0) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.1) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.2) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.3) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.5) (push) Waiting to run
CI tests / Database-Tests (PHP 7.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.0) (push) Waiting to run
CI tests / Database-Tests (PHP 8.1) (push) Waiting to run
CI tests / Database-Tests (PHP 8.2) (push) Waiting to run
CI tests / Database-Tests (PHP 8.3) (push) Waiting to run
CI tests / Database-Tests (PHP 8.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.5) (push) Waiting to run
Some checks are pending
Code Quality / PHP-CS-Fixer (PHP 8.3) (push) Waiting to run
Code Quality / PHPStan (PHP 8.4) (push) Waiting to run
Code Quality / PHPStan in addons (PHP 8.4) (push) Waiting to run
Code Quality / PHPMD (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 7.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.0) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.1) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.2) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.3) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.5) (push) Waiting to run
CI tests / Database-Tests (PHP 7.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.0) (push) Waiting to run
CI tests / Database-Tests (PHP 8.1) (push) Waiting to run
CI tests / Database-Tests (PHP 8.2) (push) Waiting to run
CI tests / Database-Tests (PHP 8.3) (push) Waiting to run
CI tests / Database-Tests (PHP 8.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.5) (push) Waiting to run
Strip HTML tags from content sent as Markdown
This commit is contained in:
commit
167ac1ec0f
2 changed files with 6 additions and 1 deletions
|
@ -689,7 +689,7 @@ class HTML
|
||||||
public static function toMarkdown(string $html): string
|
public static function toMarkdown(string $html): string
|
||||||
{
|
{
|
||||||
DI::profiler()->startRecording('rendering');
|
DI::profiler()->startRecording('rendering');
|
||||||
$converter = new HtmlConverter(['hard_break' => true]);
|
$converter = new HtmlConverter(['hard_break' => true, 'strip_tags' => true]);
|
||||||
$markdown = $converter->convert($html);
|
$markdown = $converter->convert($html);
|
||||||
|
|
||||||
DI::profiler()->stopRecording();
|
DI::profiler()->stopRecording();
|
||||||
|
|
|
@ -314,6 +314,11 @@ Karl Marx - Die ursprüngliche Akkumulation
|
||||||
'expected' => '[](https://domain.tld/photos/user/image/86912721086415cdc8e0a03226831581)',
|
'expected' => '[](https://domain.tld/photos/user/image/86912721086415cdc8e0a03226831581)',
|
||||||
'text' => '[url=https://domain.tld/photos/user/image/86912721086415cdc8e0a03226831581][img=https://domain.tld/photo/86912721086415cdc8e0a03226831581-1.png]abcfgh[/img][/url]',
|
'text' => '[url=https://domain.tld/photos/user/image/86912721086415cdc8e0a03226831581][img=https://domain.tld/photo/86912721086415cdc8e0a03226831581-1.png]abcfgh[/img][/url]',
|
||||||
],
|
],
|
||||||
|
/** @see https://github.com/friendica/friendica/pull/14908 */
|
||||||
|
'task-14908-strip-tags' => [
|
||||||
|
'expected' => 'Norddeutscher Bürger !\[Noddeutscher Bürger - Bismark Brötchen (Roger Cziwerny - pixapay)\](/rscamo/……)',
|
||||||
|
'text' => '[class=postbox-ocean]Norddeutscher Bürger [/class]',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue