}
    /**
     * Gets an array of tages to be excluded from
     * the elcude param
     * @param int $exclude What to gets excluded from i.e. SBBCodeParser_BBCode::AUTO_DETECT_EXCLUDE_EMOTICON
     * @return array
     */
    private function get_excluded_tags($exclude)
    {
        $ret = array();
        foreach ($this->bbcodes as $bbcode) {
            if ($bbcode->auto_detect_exclude() & $exclude) {
                $ret[] = $bbcode->tag();
            }
        }
        return $ret;
    }
}
IoC::singleton('BBCodeDocParser', function () {
    $instance = new SBBCodeParser_Document();
    $instance->add_emoticons(array(":)" => URL::to_asset('bundles/forums/emoticons/smile.png'), "=)" => URL::to_asset('bundles/forums/emoticons/smile.png'), "=]" => URL::to_asset('bundles/forums/emoticons/smile.png'), ":angel:" => URL::to_asset('bundles/forums/emoticons/angel.png'), ":angry:" => URL::to_asset('bundles/forums/emoticons/angry.png'), "8-)" => URL::to_asset('bundles/forums/emoticons/cool.png'), ":'(" => URL::to_asset('bundles/forums/emoticons/cwy.png'), "='(" => URL::to_asset('bundles/forums/emoticons/cwy.png'), "='[" => URL::to_asset('bundles/forums/emoticons/cwy.png'), ":ermm:" => URL::to_asset('bundles/forums/emoticons/ermm.png'), ":D" => URL::to_asset('bundles/forums/emoticons/grin.png'), "=D" => URL::to_asset('bundles/forums/emoticons/grin.png'), "<3" => URL::to_asset('bundles/forums/emoticons/heart.png'), ":(" => URL::to_asset('bundles/forums/emoticons/sad.png'), ":O" => URL::to_asset('bundles/forums/emoticons/shocked.png'), ":P" => URL::to_asset('bundles/forums/emoticons/tongue.png'), "=(" => URL::to_asset('bundles/forums/emoticons/sad.png'), "=[" => URL::to_asset('bundles/forums/emoticons/sad.png'), "=O" => URL::to_asset('bundles/forums/emoticons/shocked.png'), "=P" => URL::to_asset('bundles/forums/emoticons/tongue.png'), ";)" => URL::to_asset('bundles/forums/emoticons/wink.png'), ":alien:" => URL::to_asset('bundles/forums/emoticons/alien.png'), ":blink:" => URL::to_asset('bundles/forums/emoticons/blink.png'), ":blush:" => URL::to_asset('bundles/forums/emoticons/blush.png'), ":cheerful:" => URL::to_asset('bundles/forums/emoticons/cheerful.png'), ":devil:" => URL::to_asset('bundles/forums/emoticons/devil.png'), ":dizzy:" => URL::to_asset('bundles/forums/emoticons/dizzy.png'), ":getlost:" => URL::to_asset('bundles/forums/emoticons/getlost.png'), ":happy:" => URL::to_asset('bundles/forums/emoticons/happy.png'), ":kissing:" => URL::to_asset('bundles/forums/emoticons/kissing.png'), ":ninja:" => URL::to_asset('bundles/forums/emoticons/ninja.png'), ":pinch:" => URL::to_asset('bundles/forums/emoticons/pinch.png'), ":pouty:" => URL::to_asset('bundles/forums/emoticons/pouty.png'), ":sick:" => URL::to_asset('bundles/forums/emoticons/sick.png'), ":sideways:" => URL::to_asset('bundles/forums/emoticons/sideways.png'), ":silly:" => URL::to_asset('bundles/forums/emoticons/silly.png'), ":sleeping:" => URL::to_asset('bundles/forums/emoticons/sleeping.png'), ":unsure:" => URL::to_asset('bundles/forums/emoticons/unsure.png'), ":woot:" => URL::to_asset('bundles/forums/emoticons/w00t.png'), ":wassat:" => URL::to_asset('bundles/forums/emoticons/wassat.png')));
    return $instance;
});
class BBCodeParser
{
    public static function parse($elements)
    {
        $parser = IoC::resolve('BBCodeDocParser');
        return $parser->parse($elements)->detect_links()->detect_emails()->detect_emoticons()->get_html();
    }
}