From beb388a30d638e0dc0a421b40c76b5d96001d1d5 Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Mon, 14 Sep 2020 11:00:43 -0500 Subject: [PATCH] Fix svgdrawdoc for text containing XML invalid characters (#1110) Fixes #11929 --- gramps/plugins/docgen/svgdrawdoc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gramps/plugins/docgen/svgdrawdoc.py b/gramps/plugins/docgen/svgdrawdoc.py index 377573ad1..e60c2c29f 100644 --- a/gramps/plugins/docgen/svgdrawdoc.py +++ b/gramps/plugins/docgen/svgdrawdoc.py @@ -31,7 +31,7 @@ SVG document generator. # #------------------------------------------------------------------------- from io import StringIO - +from xml.sax.saxutils import escape #------------------------------------------------------------------------- # # Gramps modules @@ -147,7 +147,7 @@ class SvgDrawDoc(BaseDoc, DrawDoc): linex = xpos + (width - self.string_width(font, line)) / 2 self.buffer.write( '' % (linex, size) + - line + + escape(line) + '' ) self.buffer.write('\n') @@ -273,7 +273,7 @@ class SvgDrawDoc(BaseDoc, DrawDoc): self.buffer.write(' font-family:serif;') self.buffer.write( '">' + - line + + escape(line) + '\n' ) @@ -307,7 +307,7 @@ class SvgDrawDoc(BaseDoc, DrawDoc): self.buffer.write('font-family:serif;') self.buffer.write( '">' + - text + + escape(text) + '\n' )