Merge pull request #4806 from MrPetovan/task/improve-strikethrough-support

[BBCode] Improve support for strikethrough
This commit is contained in:
Tobias Diekershoff 2018-04-10 12:44:40 +02:00 committed by GitHub
commit eaff717696
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -1583,7 +1583,7 @@ class BBCode extends BaseObject
$text = preg_replace("(\[u\](.*?)\[\/u\])ism", '<u>$1</u>', $text); $text = preg_replace("(\[u\](.*?)\[\/u\])ism", '<u>$1</u>', $text);
// Check for strike-through text // Check for strike-through text
$text = preg_replace("(\[s\](.*?)\[\/s\])ism", '<strike>$1</strike>', $text); $text = preg_replace("(\[s\](.*?)\[\/s\])ism", '<s>$1</s>', $text);
// Check for over-line text // Check for over-line text
$text = preg_replace("(\[o\](.*?)\[\/o\])ism", '<span class="overline">$1</span>', $text); $text = preg_replace("(\[o\](.*?)\[\/o\])ism", '<span class="overline">$1</span>', $text);

View file

@ -221,6 +221,9 @@ class HTML
self::tagToBBCode($doc, 'b', [], '[b]', '[/b]'); self::tagToBBCode($doc, 'b', [], '[b]', '[/b]');
self::tagToBBCode($doc, 'i', [], '[i]', '[/i]'); self::tagToBBCode($doc, 'i', [], '[i]', '[/i]');
self::tagToBBCode($doc, 'u', [], '[u]', '[/u]'); self::tagToBBCode($doc, 'u', [], '[u]', '[/u]');
self::tagToBBCode($doc, 's', [], '[s]', '[/s]');
self::tagToBBCode($doc, 'del', [], '[s]', '[/s]');
self::tagToBBCode($doc, 'strike', [], '[s]', '[/s]');
self::tagToBBCode($doc, 'big', [], "[size=large]", "[/size]"); self::tagToBBCode($doc, 'big', [], "[size=large]", "[/size]");
self::tagToBBCode($doc, 'small', [], "[size=small]", "[/size]"); self::tagToBBCode($doc, 'small', [], "[size=small]", "[/size]");