markdown.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:hacksoft.io 作者: HackSoftware 项目源码 文件源码
def blockcode(self, text, lang):
        try:
            lexer = get_lexer_by_name(lang, stripall=True)
        except ClassNotFound:
            lexer = None

        if lexer:
            formatter = HtmlFormatter(noclasses=True)
            return highlight(text, lexer, formatter)
        # default
        return '\n<pre><code>{}</code></pre>\n'.format(
                            h.escape_html(text.strip()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号