Prevent stripping newlines in the middle of markdown submissions

This commit is contained in:
Michael Lazar
2019-02-13 10:10:24 -05:00
parent f45c2e97da
commit 05297eb59b
2 changed files with 5 additions and 1 deletions

View File

@@ -912,7 +912,7 @@ class Terminal(object):
flags = re.MULTILINE | re.DOTALL
pattern = '<!--{token}(.*?){token}-->'.format(token=TOKEN)
text = re.sub(pattern, '', text, flags=flags)
return re.sub( '^[\s\n]*\n', '', text, flags=flags).rstrip()
return re.sub('\A[\s\n]*\n', '', text, flags=flags).rstrip()
def clear_screen(self):
"""