Deserialise spoilers back into slash command form (#11805)

* Deserialise spoilers back into slash command form

Fixes: vector-im/element-web#26344

* Appease the linter
This commit is contained in:
Johannes Marbach 2023-10-26 15:35:02 +02:00 committed by GitHub
parent b382a1c733
commit c7c51d764f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -247,6 +247,10 @@ function parseNode(n: Node, pc: PartCreator, opts: IParseOptions, mkListItem?: (
return pc.plainWithEmoji(`${delimLeft}${tex}${delimRight}`);
}
// Spoilers are translated back into their slash command form
else if ((n as Element).hasAttribute("data-mx-spoiler")) {
return [pc.plain("/spoiler "), ...parseChildren(n, pc, opts)];
}
}
}