Improve comment formatting for markdown code block

This commit is contained in:
woorst
2019-02-02 14:45:44 -05:00
parent df3f08ed48
commit 0b1bb2d574

View File

@@ -911,7 +911,8 @@ class Terminal(object):
# Pattern can span multiple lines, allows dot to match newline chars
flags = re.MULTILINE | re.DOTALL
pattern = '<!--{token}(.*?){token}-->'.format(token=TOKEN)
return re.sub(pattern, '', text, flags=flags).strip()
text = re.sub(pattern, '', text, flags=flags)
return re.sub( '^[\s\n]*\n', '', text, flags=flags).rstrip()
def clear_screen(self):
"""