fix: preserve placeholder case when restoring project text

This commit is contained in:
muena
2026-10-06 13:43:33 +02:00
parent 7db3949d66
commit 818f9ed814
5 changed files with 54 additions and 5 deletions

View File

@@ -74,4 +74,16 @@ describe("formatierte Textwiederherstellung", () => {
),
).toBe("<b>abcMax Mustermannxyz</b>");
});
it("erhält HTML-Formatierung auch bei anders geschriebenen Platzhaltern", () => {
const html = "<b>person_01</b> und <i>Person_01</i>";
expect(restoreRichHtml(html, "person_01 und Person_01",
"max mustermann und Max Mustermann", mapping))
.toBe("<b>max mustermann</b> und <i>Max Mustermann</i>");
expect(restoreRichHtml("<b>Person_01</b> / <i>PERSON_01</i>",
"Person_01 / PERSON_01", "Person_01 / Eins", {
PERSON_01: { original: "Eins", type: "PERSON" },
person_01: { original: "Zwei", type: "PERSON" },
})).toBe("<b>Person_01</b> / <i>Eins</i>");
});
});