From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: mah@everybody.org Newsgroups: gmane.emacs.bugs Subject: xml.el incorrectly decodes entities Date: Fri, 03 Jan 2003 15:44:18 -0600 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87n0mhkix9.fsf@mah.mcdermott.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1041630615 18656 80.91.224.249 (3 Jan 2003 21:50:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 3 Jan 2003 21:50:15 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18UZhg-0004qX-00 for ; Fri, 03 Jan 2003 22:50:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18UZgk-0005X5-08 for gnu-bug-gnu-emacs@m.gmane.org; Fri, 03 Jan 2003 16:49:10 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18UZgI-0005EN-00 for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2003 16:48:42 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18UZg1-00058E-00 for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2003 16:48:40 -0500 Original-Received: from gate.mcdermott.com ([131.184.96.33]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18UZc7-0002qg-00 for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2003 16:44:23 -0500 Original-Received: from mah.mcdermott.com (mah.mcdermott.com [131.184.104.67]) by gate.mcdermott.com (8.11.2/8.11.2) with ESMTP id h03LiKE19311 for ; Fri, 3 Jan 2003 15:44:20 -0600 (CST) Original-Received: from mah by mah.mcdermott.com with local (Exim 3.36 #1 (Debian)) id 18UZc3-0007su-00 for ; Fri, 03 Jan 2003 15:44:19 -0600 Original-To: bug-gnu-emacs@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4144 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4144 xml.el incorrectly decodes entities. It should decode & last so that doubly-encoded entities are decoded correctly. (e.g. "&gt;" 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 ">" string) @@ -452,6 +450,8 @@ (setq string (replace-match "'" t nil string))) (while (string-match """ string) (setq string (replace-match "\"" t nil string))) + (while (string-match "&" 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