Bug correction: need to convert from html to plain text when loading old file format

This commit is contained in:
Olivier Keshavjee 2016-03-31 15:31:07 +02:00
parent 2e6cff73d5
commit 3571ec3f16

View file

@ -767,6 +767,15 @@ class outlineItem():
if "lastPath" in root.attrib:
self._lastPath = root.attrib["lastPath"]
# If loading from an old file format, convert to md and remove html markup
if self.type() in ["txt", "t2t"]:
self.setData(Outline.type.value, "md")
elif self.type() == "html":
self.setData(Outline.type.value, "md")
self.setData(Outline.text.value, HTML2PlainText(self.data(Outline.text.value)))
self.setData(Outline.notes.value, HTML2PlainText(self.data(Outline.notes.value)))
for child in root:
if child.tag == "outlineItem":
item = outlineItem(self._model, xml=ET.tostring(child), parent=self)