protected static function _doShortcode($m)
    {
        // allow {{foo}} syntax for escaping a tag
        if ($m[1] == '{' && $m[6] == '}') {
            return substr($m[0], 1, -1);
        }

        $tag = $m[2];
        $atts = static::_parseAttributes($m[3]);
        $listeners = EventDispatcher::instance('Shortcode')
            ->eventManager()
            ->listeners($tag);

        if (!empty($listeners)) {
            $options = [
                'atts' => (array)$atts,
                'content' => null,
                'tag' => $tag
            ];

            if (isset($m[5])) {
                $options['content'] = $m[5];
            }

            $result = EventDispatcher::instance('Shortcode')
                ->triggerArray([$tag, static::cache('context')], $options)
                ->result;

            return $m[1] . $result . $m[6];
        }

        return '';
    }