<td>Custom inline styles<br>
<br>
[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>
+ <td>You can change all <span style="text-shadow: 0 0 4px #cc0000;;">the CSS properties of this inline text.</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>
<td>Benutzerdefinierte Inline-Styles<br>
<br>
[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>
+ <td>Du kannst alle <span style="text-shadow: 0 0 4px #cc0000;;">CSS-Eigenschaften dieses Inline-Textes ä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>
// Check for list text
$text = str_replace("[*]", "<li>", $text);
- // Check for style sheet commands
+ // Check for block-level custom CSS
+ $text = preg_replace('#(?<=^|\n)\[style=(.*?)](.*?)\[/style](?:\n|$)#ism', '<div style="$1">$2</div>', $text);
+
+ // Check for inline custom CSS
$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);
+ // Add HTML new lines
+ $text = str_replace("\n", '<br>', $text);
// handle nested lists
$endlessloop = 0;