bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xml.el incorrectly decodes entities


From: mah
Subject: xml.el incorrectly decodes entities
Date: Fri, 03 Jan 2003 15:44:18 -0600

xml.el incorrectly decodes entities.  It should decode & last so
that doubly-encoded entities are decoded correctly.  (e.g. ">"
should decode to ">", not ">").

diff -u -r1.11 xml.el
--- lisp/xml.el 16 Dec 2002 17:04:58 -0000      1.11
+++ lisp/xml.el 3 Jan 2003 21:41:29 -0000
@@ -442,8 +442,6 @@
 
 (defun xml-substitute-special (string)
   "Return STRING, after subsituting special XML sequences."
-  (while (string-match "&" string)
-    (setq string (replace-match "&"  t nil string)))
   (while (string-match "<" string)
     (setq string (replace-match "<"  t nil string)))
   (while (string-match "&gt;" string)
@@ -452,6 +450,8 @@
     (setq string (replace-match "'"  t nil string)))
   (while (string-match "&quot;" string)
     (setq string (replace-match "\"" t nil string)))
+  (while (string-match "&amp;" string)
+    (setq string (replace-match "&"  t nil string)))
   string)
 
 ;;*******************************************************************

-- 
You are a mystery as deep as the sea; the more I search, the more
I find, and the more I find the more I search for you.
            -- St. Catherine of Siena




reply via email to

[Prev in Thread] Current Thread [Next in Thread]