unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: 63740@debbugs.gnu.org
Cc: Juanma Barranquero <lekktu@gmail.com>,
	"Mark A. Hershberger" <mah@everybody.org>
Subject: bug#63740: broken and questionable attribute normalisation in xml.el
Date: Fri, 26 May 2023 17:14:53 +0200	[thread overview]
Message-ID: <48DF5E96-D7EF-46A7-877A-D6EA64E6DB3E@gmail.com> (raw)

In `xml-parse-attlist`, we see:

      ;; Multiple whitespace characters should be replaced with a single one
      ;; in the attributes
      (let ((string (match-string-no-properties 1)))
	(replace-regexp-in-string "\\s-\\{2,\\}" " " string)
        ...

The call to `replace-regexp-in-string` is of course useless and there is now a compiler warning telling us, which is how this came to light.

However, should we really collapse whitespace here? If I'm reading the spec correctly, it's not done for CDATA attributes and we have no reason to believe any other type, do we?

I'm no XML expert but it looks like the code is correct and we can just remove the call to `replace-regexp-in-string` (and the misleading comment). Or?






             reply	other threads:[~2023-05-26 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26 15:14 Mattias Engdegård [this message]
2023-05-30 15:50 ` bug#63740: broken and questionable attribute normalisation in xml.el Mattias Engdegård

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=48DF5E96-D7EF-46A7-877A-D6EA64E6DB3E@gmail.com \
    --to=mattias.engdegard@gmail.com \
    --cc=63740@debbugs.gnu.org \
    --cc=lekktu@gmail.com \
    --cc=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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).