From 1b4239573a39492f352830a24b38bd8ec59b36a7 Mon Sep 17 00:00:00 2001 From: Dr John O'Hare Date: Mon, 11 Sep 2023 14:03:53 +0100 Subject: [PATCH] Add & handling to links --- src/freeplane.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/freeplane.py b/src/freeplane.py index 1ca8eb2..5ea5390 100644 --- a/src/freeplane.py +++ b/src/freeplane.py @@ -1225,15 +1225,22 @@ def plaintext(self, strText, modified=''): @property def hyperlink(self): - return self._node.attrib.get("LINK","") + link = self._node.attrib.get("LINK","") + + # Unescape XML encoding + link = link.replace('&', '&') + + return link @hyperlink.setter def hyperlink(self, strLink, modified=''): self._node.attrib["LINK"] = strLink + # Escape & characters + strLink = strLink.replace('&', '&') - - + self._node.attrib["LINK"] = strLink + # # set creation and modification dates # @@ -2847,4 +2854,3 @@ def getText(self, strRootAttribute, strTitleText, strPortion): # create execute class init with command line environment Mindmap(id='cli') -