diff --git a/doc/BBCode.md b/doc/BBCode.md index 753bc6942..0404c381b 100644 --- a/doc/BBCode.md +++ b/doc/BBCode.md @@ -650,10 +650,4 @@ On Mastodon this field is used for the content warning. [style=text-shadow: 0 0 4px #CC0000;]You can change all the CSS properties of this block.[/style] You can change all the CSS properties of this block. - - Custom class block
-
-[class=custom]If the class exists, this block will have the custom class style applied.[/class] -
<span class="custom">If the class exists,
this block will have the custom class
style applied.</span>
- diff --git a/doc/de/BBCode.md b/doc/de/BBCode.md index ded52cdb7..534ebcc54 100644 --- a/doc/de/BBCode.md +++ b/doc/de/BBCode.md @@ -609,13 +609,5 @@ Dieses Feld wird von Mastodon für die Inhaltswarnung (content warning) verw [style=text-shadow: 0 0 4px #CC0000;]Du kannst alle CSS-Eigenschaften eines Blocks ändern-[/style] Du kannst alle CSS-Eigenschaften eines Blocks ändern- - - Benutzerdefinierte CSS Klassen
-
-[class=custom]Wenn die vergebene Klasse in den CSS Anweisungen existiert, wird sie angewandt.[/class] -
<span class="custom">Wenn die
-vergebene Klasse in den CSS Anweisungen
-existiert,wird sie angewandt.</span>
- diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 943842c3b..696cc7d8c 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1648,7 +1648,11 @@ class BBCode // Check for style sheet commands $text = preg_replace("(\[style=(.*?)\](.*?)\[\/style\])ism", '$2', $text); + // Mastodon Emoji (internal tag, do not document for users) + $text = preg_replace("(\[emoji=(.*?)](.*?)\[/emoji])ism", '$2', $text); + // Check for CSS classes + // @deprecated since 2021.12, left for backward-compatibility reasons $text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism", '$2', $text); // handle nested lists diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 51a7ede2f..f10df66b6 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -96,7 +96,7 @@ class Processor array_combine( array_column($emojis, 'name'), array_map(function ($emoji) { - return '[class=emoji mastodon][img=' . $emoji['href'] . ']' . $emoji['name'] . '[/img][/class]'; + return '[emoji=' . $emoji['href'] . ']' . $emoji['name'] . '[/emoji]'; }, $emojis) ) ); diff --git a/tests/src/Content/Text/BBCodeTest.php b/tests/src/Content/Text/BBCodeTest.php index 730e0b6da..cb17758c7 100644 --- a/tests/src/Content/Text/BBCodeTest.php +++ b/tests/src/Content/Text/BBCodeTest.php @@ -292,6 +292,10 @@ Karl Marx - Die ursprüngliche Akkumulation 'try_oembed' => false, 'simpleHtml' => BBCode::TWITTER, ], + 'task-10886-deprecate-class' => [ + 'expectedHTML' => ':heart_nb:', + 'text' => '[emoji=https://fedi.underscore.world/emoji/custom/custom/heart_nb.png]:heart_nb:[/emoji]', + ] ]; }