From cc548a6ba9ccc3bab032ad586cd1946d2c1e6bd4 Mon Sep 17 00:00:00 2001 From: Tommy Jollyboat <11634808+ComedyTomedy@users.noreply.github.com> Date: Fri, 9 Apr 2021 20:24:25 +0100 Subject: [PATCH] Escape entities with xml-escape-string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This might not cover all cases, but if it does, it closes #1 ☺ --- xml-to-string.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xml-to-string.el b/xml-to-string.el index 9fb0856..383f23f 100644 --- a/xml-to-string.el +++ b/xml-to-string.el @@ -67,7 +67,7 @@ (defun xml-to-string-parse-child-node (child-node) "Convert `node | string' to string representation" (if (stringp child-node) - child-node + (xml-escape-string child-node) (xml-to-string-parse-node child-node))) (defun xml-to-string-parse-qname (node) @@ -79,7 +79,7 @@ string like \"qname=value qname=value\" ..." (mapconcat (lambda (elem) (concat (symbol-name (car elem)) "=" - "\"" (cdr elem) "\"")) attr-list " ")) + "\"" (xml-escape-string (cdr elem)) "\"")) attr-list " ")) (provide 'xml-to-string)