Felix Lechner via "Developers list for Guile, the GNU extensibility
library" <guile-devel@gnu.org> writes:

> Hi Tomas,
>
> On Tue, Feb 04 2025, Tomas Volf wrote:
>
>> automatically decoding now would lead to double decoding.
>
> Will a second decoding step for HTML entities, which is the most likely
> workaround, mess up strings like "a&b" or "bbb\"ccc'ddd" ?

Sadly yes:

--8<---------------cut here---------------start------------->8---
scheme@(htmlprag)> (html->sxml "<a href=\"a&amp;amp;b\"></a>")
$15 = (*TOP* (a (@ (href "a&amp;amp;b"))))    ; Parsed value
scheme@(htmlprag)> (html->sxml "a&amp;amp;b")
$16 = (*TOP* "a&amp;b")                       ; First decode
scheme@(htmlprag)> (html->sxml "a&amp;b")     
$17 = (*TOP* "a&b")                           ; Second decode
--8<---------------cut here---------------end--------------->8---

So any fix needs to be opt-in.

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Attachment: signature.asc
Description: PGP signature

Reply via email to