From 2b42dd258e9454c2fb3b6b19e27f98721a936f9d Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Sun, 24 Sep 2017 11:57:35 -0700 Subject: [PATCH] Special char in place's name breaks xdot view Issue #10174 --- gramps/plugins/graph/gvfamilylines.py | 5 ++++- gramps/plugins/graph/gvhourglass.py | 2 ++ gramps/plugins/graph/gvrelgraph.py | 10 ++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gramps/plugins/graph/gvfamilylines.py b/gramps/plugins/graph/gvfamilylines.py index be07c94ad..150deebc7 100644 --- a/gramps/plugins/graph/gvfamilylines.py +++ b/gramps/plugins/graph/gvfamilylines.py @@ -867,7 +867,8 @@ class FamilyLinesReport(Report): label += '' # at the very least, the label must have the person's name - label += name + name = name.replace('"', '"') + label += name.replace('<', '<').replace('>', '>') if self.includeid == 1: # same line label += " (%s)" % p_id elif self.includeid == 2: # own line @@ -1097,4 +1098,6 @@ class FamilyLinesReport(Report): place_text = location.get(PlaceType.STATE) elif location.get(PlaceType.COUNTRY): place_text = location.get(PlaceType.COUNTRY) + place_text = place_text.replace('<', '<') + place_text = place_text.replace('>', '>') return place_text diff --git a/gramps/plugins/graph/gvhourglass.py b/gramps/plugins/graph/gvhourglass.py index e5350489d..38547b734 100644 --- a/gramps/plugins/graph/gvhourglass.py +++ b/gramps/plugins/graph/gvhourglass.py @@ -211,6 +211,8 @@ class HourGlassReport(Report): """ p_id = person.get_gramps_id() name = self._name_display.display(person) + name = name.replace('"', '"') + name = name.replace('<', '<').replace('>', '>') birth_evt = get_birth_or_fallback(self.__db, person) if birth_evt: diff --git a/gramps/plugins/graph/gvrelgraph.py b/gramps/plugins/graph/gvrelgraph.py index 8b030380d..09dafaaa6 100644 --- a/gramps/plugins/graph/gvrelgraph.py +++ b/gramps/plugins/graph/gvrelgraph.py @@ -566,11 +566,8 @@ class RelGraphReport(Report): # at the very least, the label must have the person's name p_name = self._name_display.display(person) - if self.use_html_output: - # avoid < and > in the name, as this is html text - label += p_name.replace('<', '<').replace('>', '>') - else: - label += p_name + p_name = p_name.replace('"', '"') + label += p_name.replace('<', '<').replace('>', '>') p_id = person.get_gramps_id() if self.includeid == 1: # same line label += " (%s)" % p_id @@ -719,7 +716,8 @@ class RelGraphReport(Report): empty string """ if event and self.event_choice in [2, 3, 5, 6, 7]: - return _pd.display_event(self._db, event) + place = _pd.display_event(self._db, event) + return place.replace('<', '<').replace('>', '>') return '' #------------------------------------------------------------------------