]> git.eshelyaron.com Git - emacs.git/commit
Fix DOM printing
authorDavid Ponce <da_vid@orange.fr>
Sat, 8 Feb 2025 12:55:16 +0000 (13:55 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 15 Feb 2025 19:34:00 +0000 (20:34 +0100)
commit662ccfd2a0f85ba720c8bfe57f69df312e710d46
tree6564d4a96ca8a31e6e5af8283c1b3e824a238732
parent3a6db3a92577669f71bb59382114446fb00c265e
Fix DOM printing

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.
* lisp/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.  (Bug#5928)

* test/lisp/dom-tests.el (dom-tests-print-svg)
(dom-tests-print-html-boolean): New tests.

(cherry picked from commit 7ad139d72108df78763b570b376fbe4aad952f72)
lisp/dom.el
test/lisp/dom-tests.el