]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #9676 from MrPetovan/bug/9639-limit-ap-emoji-size
authorMichael Vogel <icarus@dabo.de>
Fri, 18 Dec 2020 18:40:47 +0000 (19:40 +0100)
committerGitHub <noreply@github.com>
Fri, 18 Dec 2020 18:40:47 +0000 (19:40 +0100)
Restore Mastodon emoji span classes

src/Content/Text/BBCode.php
tests/src/Content/Text/BBCodeTest.php

index 73503cece8a8e54e972eaaf200d7c12acfaa910e..d238e265eddf8bad85b564d4ebca61bf119cf84e 100644 (file)
@@ -50,7 +50,7 @@ use Friendica\Util\XML;
 class BBCode
 {
        // Update this value to the current date whenever changes are made to BBCode::convert
-       const VERSION = '2020-12-06';
+       const VERSION = '2020-12-18-small-emojis';
 
        const INTERNAL = 0;
        const API = 2;
@@ -1467,7 +1467,7 @@ class BBCode
                                $text = preg_replace("(\[style=(.*?)\](.*?)\[\/style\])ism", '<span style="$1">$2</span>', $text);
 
                                // Check for CSS classes
-                               $text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism", '<span style="$1">$2</span>', $text);
+                               $text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism", '<span class="$1">$2</span>', $text);
 
                                // handle nested lists
                                $endlessloop = 0;
index 1769e6fd725886ab88b9db0397597ef1dc3bba66..2eb5d1903d1aaccf9579392737c095c6826dbc23 100644 (file)
@@ -277,6 +277,10 @@ class BBCodeTest extends MockedTest
                                'expectedHTML' => '<span style="color:#FFFFFF;">dare to move your mouse here</span>',
                                'text' => '[color=FFFFFF]dare to move your mouse here[/color]'
                        ],
+                       'bug-9639-span-classes' => [
+                               'expectedHTML' => '<span class="arbitrary classes">Test</span>',
+                               'text' => '[class=arbitrary classes]Test[/class]',
+                       ],
                ];
        }