Merge pull request #10889 from MrPetovan/task/10886-bbcode-remove-class
Deprecate limited-use and potentially confusing [class] BBCode tag
This commit is contained in:
commit
1dc613a0a1
5 changed files with 9 additions and 15 deletions
|
@ -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]</td>
|
||||
<td><span style="text-shadow: 0 0 4px #cc0000;;">You can change all the CSS properties of this block.</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Custom class block<br>
|
||||
<br>
|
||||
[class=custom]If the class exists, this block will have the custom class style applied.[/class]</td>
|
||||
<td><pre><span class="custom">If the class exists,<br> this block will have the custom class<br> style applied.</span></pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -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]</td>
|
||||
<td><span style="text-shadow: 0 0 4px #cc0000;;">Du kannst alle CSS-Eigenschaften eines Blocks ändern-</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Benutzerdefinierte CSS Klassen<br>
|
||||
<br>
|
||||
[class=custom]Wenn die vergebene Klasse in den CSS Anweisungen existiert, wird sie angewandt.[/class]</td>
|
||||
<td><pre><span class="custom">Wenn die<br>
|
||||
vergebene Klasse in den CSS Anweisungen<br>
|
||||
existiert,wird sie angewandt.</span></pre></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -1648,7 +1648,11 @@ class BBCode
|
|||
// Check for style sheet commands
|
||||
$text = preg_replace("(\[style=(.*?)\](.*?)\[\/style\])ism", '<span style="$1">$2</span>', $text);
|
||||
|
||||
// Mastodon Emoji (internal tag, do not document for users)
|
||||
$text = preg_replace("(\[emoji=(.*?)](.*?)\[/emoji])ism", '<span class="mastodon emoji"><img src="$1" alt="$2" title="$2"/></span>', $text);
|
||||
|
||||
// Check for CSS classes
|
||||
// @deprecated since 2021.12, left for backward-compatibility reasons
|
||||
$text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism", '<span class="$1">$2</span>', $text);
|
||||
|
||||
// handle nested lists
|
||||
|
|
|
@ -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)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -292,6 +292,10 @@ Karl Marx - Die ursprüngliche Akkumulation
|
|||
'try_oembed' => false,
|
||||
'simpleHtml' => BBCode::TWITTER,
|
||||
],
|
||||
'task-10886-deprecate-class' => [
|
||||
'expectedHTML' => '<span class="mastodon emoji"><img src="https://fedi.underscore.world/emoji/custom/custom/heart_nb.png" alt=":heart_nb:" title=":heart_nb:"></span>',
|
||||
'text' => '[emoji=https://fedi.underscore.world/emoji/custom/custom/heart_nb.png]:heart_nb:[/emoji]',
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue