mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
Bug correction: need to convert from html to plain text when loading old file format
This commit is contained in:
parent
2e6cff73d5
commit
3571ec3f16
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue