diff --git a/src/Compat/BBCodeParser.php b/src/Compat/BBCodeParser.php index a739ed6..0fbeef5 100644 --- a/src/Compat/BBCodeParser.php +++ b/src/Compat/BBCodeParser.php @@ -18,15 +18,17 @@ class BBCodeParser { - private static object $parser; + private static array $parsers; - public static function load(): object + public function __construct(public bool $for_print = false) {} + + public static function load(bool $for_print = false): object { - if (! isset(self::$parser)) { - self::$parser = new self(); + if (! isset(self::$parsers[(int) $for_print])) { + self::$parsers[(int) $for_print] = new self($for_print); } - return self::$parser; + return self::$parsers[(int) $for_print]; } public function parse(