From c034fa7baa30e10ebbc6974aea58966ae983a5bb Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 12 Sep 2019 22:17:55 -0400 Subject: [PATCH] Use
tag for spoilers BCode --- src/Content/Text/BBCode.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 65d037b83d..02c9551027 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1475,24 +1475,22 @@ class BBCode extends BaseObject $text = preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/sm", "$2", $text); // Declare the format for [spoiler] layout - $SpoilerLayout = '
$1
'; + $SpoilerLayout = '
' . L10n::t('Click to open/close') . '$1
'; // Check for [spoiler] text // handle nested quotes $endlessloop = 0; while ((strpos($text, "[/spoiler]") !== false) && (strpos($text, "[spoiler]") !== false) && (++$endlessloop < 20)) { - $text = preg_replace("/\[spoiler\](.*?)\[\/spoiler\]/ism", "$SpoilerLayout", $text); + $text = preg_replace("/\[spoiler\](.*?)\[\/spoiler\]/ism", $SpoilerLayout, $text); } - // Check for [spoiler=Author] text - - $t_wrote = L10n::t('$1 wrote:'); + // Check for [spoiler=Title] text // handle nested quotes $endlessloop = 0; while ((strpos($text, "[/spoiler]")!== false) && (strpos($text, "[spoiler=") !== false) && (++$endlessloop < 20)) { $text = preg_replace("/\[spoiler=[\"\']*(.*?)[\"\']*\](.*?)\[\/spoiler\]/ism", - "
" . $t_wrote . "
$2
", + '
$1$2
', $text); }