<s> from __future__ import unicode_literals <EOL> from jinja2 import Markup <EOL> from jinja2 . ext import Extension <EOL> from . shortcuts import render_bbcodes <EOL> def do_bbcode ( text ) : <EOL> return Markup ( render_bbcodes ( text ) ) <EOL> class PreciseBBCodeExtension ( Extension ) : <EOL> def __init__ ( self , environment ) : <EOL> super ( PreciseBBCodeExtension , self ) . __init__ ( environment ) <EOL> self . environment . globals . update ( { <EOL> '<STR_LIT>' : do_bbcode , <EOL> } ) <EOL> self . environment . filters . update ( { <EOL> '<STR_LIT>' : do_bbcode , <EOL> } ) <EOL> bbcode = PreciseBBCodeExtension </s>
