mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-14 08:54:34 +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:
|
if "lastPath" in root.attrib:
|
||||||
self._lastPath = root.attrib["lastPath"]
|
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:
|
for child in root:
|
||||||
if child.tag == "outlineItem":
|
if child.tag == "outlineItem":
|
||||||
item = outlineItem(self._model, xml=ET.tostring(child), parent=self)
|
item = outlineItem(self._model, xml=ET.tostring(child), parent=self)
|
||||||
|
|
Loading…
Reference in a new issue