Make sure to not include draft name in the title extracted from draft text.

- Legacy-Id: 12176
This commit is contained in:
Henrik Levkowetz 2016-10-19 12:18:59 +00:00
parent 5c562abec2
commit 887455c1d5

View file

@ -927,8 +927,9 @@ class Draft():
if match:
title = match.group(1)
title = title.strip()
title = re.sub('\s*\n\s*', ' ', title)
title = re.sub(' +', ' ', title)
title = re.sub(r'(?s)\n\s*\<?draft-.*$','', title)
title = re.sub(r'\s*\n\s*', ' ', title)
title = re.sub(r' +', ' ', title)
self._title = title
return self._title
self.errors["title"] = "Could not find the title on the first page."