emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#68508: closed ([PATCH] ; (dom-print): Use HTML entities for reserved


From: GNU bug Tracking System
Subject: bug#68508: closed ([PATCH] ; (dom-print): Use HTML entities for reserved characters.)
Date: Sat, 20 Jan 2024 09:43:02 +0000

Your message dated Sat, 20 Jan 2024 11:42:07 +0200
with message-id <83frystk7k.fsf@gnu.org>
and subject line Re: bug#68508: [PATCH] ; (dom-print): Use HTML entities for 
reserved characters.
has caused the debbugs.gnu.org bug report #68508,
regarding [PATCH] ; (dom-print): Use HTML entities for reserved characters.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
68508: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68508
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] ; (dom-print): Use HTML entities for reserved characters. Date: Tue, 16 Jan 2024 14:24:40 +0100 User-agent: Gnus/5.13 (Gnus v5.13)
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">&lt;div class="default"&gt; &lt;/div&gt;</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).



Attachment: 0001-dom-print-Use-HTML-entities-for-reserved-characters.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: bug#68508: [PATCH] ; (dom-print): Use HTML entities for reserved characters. Date: Sat, 20 Jan 2024 11:42:07 +0200
> From: Eshel Yaron <me@eshelyaron.com>
> Cc: 68508@debbugs.gnu.org
> Date: Tue, 16 Jan 2024 17:29:12 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Thanks, but could you please also add tests for this?
> 
> Sure, I've added a test to dom-tests.el in the updated patch below.

Thanks, installed on master, and closing the bug.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]