[bbcode] make sure bbcode css only applies to bbcode
This commit is contained in:
@@ -7,6 +7,12 @@ namespace Shimmie2;
|
||||
class BBCode extends FormatterExtension
|
||||
{
|
||||
public function format(string $text): string
|
||||
{
|
||||
$text = $this->_format($text);
|
||||
return "<span class='bbcode'>$text</span>";
|
||||
}
|
||||
|
||||
public function _format(string $text): string
|
||||
{
|
||||
$text = $this->extract_code($text);
|
||||
foreach ([
|
||||
@@ -158,7 +164,7 @@ class BBCode extends FormatterExtension
|
||||
$middle = base64_decode(substr($text, $start + $l1, ($end - $start - $l1)));
|
||||
$ending = substr($text, $end + $l2, (strlen($text) - $end + $l2));
|
||||
|
||||
$text = $beginning . "<pre>" . $middle . "</pre>" . $ending;
|
||||
$text = $beginning . "<pre class='code'>" . $middle . "</pre>" . $ending;
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
Reference in New Issue
Block a user