GNU bug report logs -
#68508
[PATCH] ; (dom-print): Use HTML entities for reserved characters.
Previous Next
Reported by: Eshel Yaron <me <at> eshelyaron.com>
Date: Tue, 16 Jan 2024 13:26:02 UTC
Severity: normal
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Tags: patch
This makes `dom-print` encode HTML reserved characters that occur in
string elements of the DOM, to ensure the validity of the result.
For example, put the following in `foo.html`:
--8<---------------cut here---------------start------------->8---
<html><body>
Add ‘<samp class="samp"><div class="default"> </div></samp>’ tags around the fontified body.
<body><html>
--8<---------------cut here---------------end--------------->8---
(Fragment from https://www.gnu.org/software/emacs/manual/html_mono/htmlfontify.html)
Open that file in Emacs and say `M-: (require 'dom)` and then
`(dom-print (libxml-parse-html-region))` in the HTML buffer. This
produces invalid HTML since `libxml-parse-html-region` correctly decodes
HTML entities, but `dom-print` doesn't encode (without this patch).
[0001-dom-print-Use-HTML-entities-for-reserved-characters.patch (text/patch, attachment)]
This bug report was last modified 1 year and 120 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.