From 7c1b39338123a6c94f03664852134d70c396c8fb Mon Sep 17 00:00:00 2001 From: Yarchik Date: Wed, 8 Jul 2026 17:59:21 +0100 Subject: [PATCH] fix: encode special characters in HTMLElement textContent setter The HTMLElement textContent setter stored the raw string in a TextNode without escaping, so setting textContent to a value containing '<', '>' or '&' produced markup that was re-interpreted as HTML on serialization and re-parsing (e.g. textContent = ''; + const reparsed = parse(div.toString()).firstChild; + reparsed.childNodes.should.have.length(1); + reparsed.textContent.should.eql(''); + }); +});