markup.py 文件源码

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

项目:python-ansimarkup 作者: gvalkov 项目源码 文件源码
def parse(self, text):
        '''Return a string with markup tags converted to ansi-escape sequences.'''
        tags, results = [], []

        text = self.re_tag.sub(lambda m: self.sub_tag(m, tags, results), text)

        if self.always_reset:
            if not text.endswith(Style.RESET_ALL):
                text += Style.RESET_ALL

        return text
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号