mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-06 15:24:27 +02:00
Merge pull request #14908 from randompenguin1/develop
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
|
||||
{
|
||||
DI::profiler()->startRecording('rendering');
|
||||
$converter = new HtmlConverter(['hard_break' => true]);
|
||||
$converter = new HtmlConverter(['hard_break' => true, 'strip_tags' => true]);
|
||||
$markdown = $converter->convert($html);
|
||||
|
||||
DI::profiler()->stopRecording();
|
||||
|
|
|
@ -314,6 +314,11 @@ Karl Marx - Die ursprüngliche Akkumulation
|
|||
'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]',
|
||||
],
|
||||
/** @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