def block_code(self, text, lang):
        """text: unicode text to render"""

        if not lang:
            return self._code_no_lexer(text)

        try:
            lexer = get_lexer_by_name(lang, stripall=True)
        except ClassNotFound:  # lexer not found, use plain text
            return self._code_no_lexer(text)

        formatter = HtmlFormatter()

        return highlight(text, lexer, formatter)
def block_code(self, text, lang):
        """text: unicode text to render"""

        if not lang:
            return self._code_no_lexer(text)

        try:
            lexer = get_lexer_by_name(lang, stripall=True)
        except ClassNotFound:  # lexer not found, use plain text
            return self._code_no_lexer(text)

        formatter = HtmlFormatter()

        return highlight(text, lexer, formatter)
def block_code ( self , text , lang ) : if not lang : return self . _code_no_lexer ( text ) try : lexer = get_lexer_by_name ( lang , stripall = True ) except ClassNotFound : # lexer not found, use plain text return self . _code_no_lexer ( text ) formatter = HtmlFormatter ( ) return highlight ( text , lexer , formatter )
text: unicode text to render
text : unicode text to render