GNU bug report logs - #75928
31.0.50; `dom-print' often fails to print an SVG DOM

Previous Next

Package: emacs;

Reported by: David Ponce <da_vid <at> orange.fr>

Date: Wed, 29 Jan 2025 15:53:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 75928 <at> debbugs.gnu.org (full text, mbox):

From: David Ponce <da_vid <at> orange.fr>
To: 75928 <at> debbugs.gnu.org
Subject: Re: 31.0.50; `dom-print' often fails to print an SVG DOM
Date: Wed, 5 Feb 2025 13:01:04 +0100
[Message part 1 (text/plain, inline)]
Hello,

I attached a new patch that also avoid printing attributes without a
value (value is nil in the DOM).

I also refreshed the list of HTML boolean attributes from the current
standard, and put checking for a boolean attribute in a separate
inline function for clarity.

The patch also slightly improve the code by computing the indentation
column outside of loop and delegating indentation to `indent-line-to'.

Here is a change log:

2025-02-05  David Ponce  <da_vid <at> orange.fr>

	Fix DOM printing when an attribute value is not a string,
	which is often the case in SVG DOM.  Don't print attributes
	without a value.  Refresh the list of HTML boolean attributes.

	* dom.el (dom--html-boolean-attribute-p): New function.
	(dom-print): Use it.  Convert attribute value to string before
	to call `url-insert-entities-in-string'.  Don't print
	attribute without a value.  Compute indentation column outside
	of loop and call `indent-line-to' to indent line.

This new version passes the `dom-tests-print'.

Thanks!
[dom-patch-V1.patch (text/x-patch, attachment)]

This bug report was last modified 147 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.