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
评论列表
文章目录