From 432c07343e1e5f97fe35c63b2573ce32f0f8b395 Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Wed, 14 Jul 2010 12:00:58 -0700 Subject: [PATCH] SVG backend: escape `<' and `&' in UTF-8 strings. This is required to create valid SVG. All other characters within or elements are permitted. --- scm/output-svg.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scm/output-svg.scm b/scm/output-svg.scm index 2a98529e75..654c3a36a1 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -676,4 +676,8 @@ (ec 'a))) (define (utf-8-string pango-font-description string) - (dispatch `(fontify ,pango-font-description ,(entity 'tspan string)))) + (let ((escaped-string (string-regexp-substitute + "<" "<" + (string-regexp-substitute "&" "&" string)))) + (dispatch `(fontify ,pango-font-description + ,(entity 'tspan escaped-string))))) -- 2.39.2