all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* xml.el incorrectly decodes entities
@ 2003-01-03 21:44 mah
  2003-01-04  9:34 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: mah @ 2003-01-03 21:44 UTC (permalink / raw)



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: xml.el incorrectly decodes entities
  2003-01-03 21:44 xml.el incorrectly decodes entities mah
@ 2003-01-04  9:34 ` Thien-Thi Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Thien-Thi Nguyen @ 2003-01-04  9:34 UTC (permalink / raw)
  Cc: bug-gnu-emacs

mah@everybody.org writes:

   It should decode &amp; last

thanks.  fixed in cvs.

thi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-04  9:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-03 21:44 xml.el incorrectly decodes entities mah
2003-01-04  9:34 ` Thien-Thi Nguyen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.