From: Patrick McCarty Date: Wed, 14 Jul 2010 19:00:58 +0000 (-0700) Subject: SVG backend: escape `<' and `&' in UTF-8 strings. X-Git-Tag: release/2.13.29-1~63 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=432c07343e1e5f97fe35c63b2573ce32f0f8b395;p=lilypond.git SVG backend: escape `<' and `&' in UTF-8 strings. This is required to create valid SVG. All other characters within or elements are permitted. --- 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)))))