Deal with empty bodies

Close #780.
This commit is contained in:
MinchinWeb 2020-01-04 21:57:37 -07:00
parent 0c0049166f
commit baeb8c143c

View file

@ -22,7 +22,7 @@ class Entry:
def _parse_text(self): def _parse_text(self):
raw_text = self.text raw_text = self.text
lines = raw_text.splitlines() lines = raw_text.splitlines()
if lines[0].strip().endswith("*"): if lines and lines[0].strip().endswith("*"):
self.starred = True self.starred = True
raw_text = lines[0].strip("\n *") + "\n" + "\n".join(lines[1:]) raw_text = lines[0].strip("\n *") + "\n" + "\n".join(lines[1:])
self._title, self._body = split_title(raw_text) self._title, self._body = split_title(raw_text)