all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: mah@everybody.org
Subject: xml.el incorrectly decodes entities
Date: Fri, 03 Jan 2003 15:44:18 -0600	[thread overview]
Message-ID: <87n0mhkix9.fsf@mah.mcdermott.com> (raw)


xml.el incorrectly decodes entities.  It should decode &amp; last so
that doubly-encoded entities are decoded correctly.  (e.g. "&amp;gt;"
should decode to "&gt;", 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 "&amp;" string)
-    (setq string (replace-match "&"  t nil string)))
   (while (string-match "&lt;" 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	other threads:[~2003-01-03 21:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-03 21:44 mah [this message]
2003-01-04  9:34 ` xml.el incorrectly decodes entities Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87n0mhkix9.fsf@mah.mcdermott.com \
    --to=mah@everybody.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.