From b0624bf353180231c181003558d403531b1f2fb5 Mon Sep 17 00:00:00 2001
From: maximilliangrand <214999687+maximilliangrand@users.noreply.github.com>
Date: Sat, 15 Aug 2026 12:14:43 +0200
Subject: [PATCH 1/2] fix: acknowledge self-closing flag on foreign integration
points
In HTML mode the self-closing flag is honored for foreign (SVG/MathML)
elements, e.g. `` closes `rect` and keeps `x` as a
sibling. Integration points such as ``, `` inside
`",
+ ],
+ "endIndex": 50,
+ "startIndex": 28,
+ },
+ {
+ "$event": "closetag",
+ "data": [
+ "title",
+ true,
+ ],
+ "endIndex": 51,
+ "startIndex": 51,
+ },
+ {
+ "$event": "closetag",
+ "data": [
+ "foreignObject",
+ true,
+ ],
+ "endIndex": 51,
+ "startIndex": 51,
+ },
+ {
+ "$event": "closetag",
+ "data": [
+ "svg",
+ true,
+ ],
+ "endIndex": 51,
+ "startIndex": 51,
+ },
+]
+`;
+
+exports[`Events > Self-closing MathML annotation-xml acknowledges the slash 1`] = `
+[
+ {
+ "$event": "opentagname",
+ "data": [
+ "math",
+ ],
+ "endIndex": 5,
+ "startIndex": 0,
+ },
+ {
+ "$event": "opentag",
+ "data": [
+ "math",
+ {},
+ false,
+ ],
+ "endIndex": 5,
+ "startIndex": 0,
+ },
+ {
+ "$event": "opentagname",
+ "data": [
+ "annotation-xml",
+ ],
+ "endIndex": 21,
+ "startIndex": 6,
+ },
+ {
+ "$event": "opentag",
+ "data": [
+ "annotation-xml",
+ {},
+ false,
+ ],
+ "endIndex": 22,
+ "startIndex": 6,
+ },
+ {
+ "$event": "closetag",
+ "data": [
+ "annotation-xml",
+ true,
+ ],
+ "endIndex": 22,
+ "startIndex": 6,
+ },
+ {
+ "$event": "text",
+ "data": [
+ "x",
+ ],
+ "endIndex": 23,
+ "startIndex": 23,
+ },
+ {
+ "$event": "closetag",
+ "data": [
+ "math",
+ false,
+ ],
+ "endIndex": 30,
+ "startIndex": 24,
+ },
+]
+`;
+
exports[`Events > Self-closing MathML integration point acknowledges the slash 1`] = `
[
{
@@ -2834,6 +2995,73 @@ exports[`Events > Self-closing MathML integration point acknowledges the slash 1
]
`;
+exports[`Events > Self-closing SVG desc acknowledges the slash 1`] = `
+[
+ {
+ "$event": "opentagname",
+ "data": [
+ "svg",
+ ],
+ "endIndex": 4,
+ "startIndex": 0,
+ },
+ {
+ "$event": "opentag",
+ "data": [
+ "svg",
+ {},
+ false,
+ ],
+ "endIndex": 4,
+ "startIndex": 0,
+ },
+ {
+ "$event": "opentagname",
+ "data": [
+ "desc",
+ ],
+ "endIndex": 10,
+ "startIndex": 5,
+ },
+ {
+ "$event": "opentag",
+ "data": [
+ "desc",
+ {},
+ false,
+ ],
+ "endIndex": 11,
+ "startIndex": 5,
+ },
+ {
+ "$event": "closetag",
+ "data": [
+ "desc",
+ true,
+ ],
+ "endIndex": 11,
+ "startIndex": 5,
+ },
+ {
+ "$event": "text",
+ "data": [
+ "x",
+ ],
+ "endIndex": 12,
+ "startIndex": 12,
+ },
+ {
+ "$event": "closetag",
+ "data": [
+ "svg",
+ false,
+ ],
+ "endIndex": 18,
+ "startIndex": 13,
+ },
+]
+`;
+
exports[`Events > Self-closing SVG integration point acknowledges the slash 1`] = `
[
{