import bbcode
from . import formatters
PARSER = bbcode.Parser(newline="\n",escape_html=True,replace_links=False)

def _():
    for i in formatters.SIMPLE_FORMATTERS:
        if len(i) == 0:
            continue
    
        if len(i) == 1:
            kwargs = {}
        else:
            kwargs = i[1]
        PARSER.add_simple_formatter(*i[0],**kwargs)
    
    for i in formatters.FORMATTERS:
        if len(i) == 0:
            continue
    
        if len(i) == 1:
            kwargs = {}
        else:
            kwargs = i[1]
            
        PARSER.add_formatter(*i[0],**kwargs)
        
_()
del _