<?php

namespace App\Helpers\BBCode\Tags;
 
class CodeTag extends Tag {

    function __construct()
    {
        $this->token = 'code';
        $this->element = 'code';
    }

    public function FormatResult($result, $parser, $state, $scope, $options, $text)
    {
        $text = $parser->CleanString($text);
        return '<code>' . $text . '</code>';
    }
}

<?php

namespace App\Helpers\BBCode\Tags;
 
class CodeTag extends Tag {

    function __construct()
    {
        $this->token = 'code';
        $this->element = 'code';
    }

    public function FormatResult($result, $parser, $state, $scope, $options, $text)
    {
        // The text is already html escaped at this point (the default element cleans all strings)
        return '<code>' . $text . '</code>';
    }
}

Fix double escape in the code tag
Fix double escape in the code tag
