diff --git a/data-migration/package-lock.json b/data-migration/package-lock.json
index 4de3be8..3de550d 100644
--- a/data-migration/package-lock.json
+++ b/data-migration/package-lock.json
@@ -785,16 +785,16 @@
}
},
"node_modules/@hono/node-server": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.3.tgz",
- "integrity": "sha512-TA//nWMqPhbfdfneACk6t5a9eqbS9lABEPyKn0/xZTah3H3U2XaVg85rJFl0/Fyit0I552YDHgXGVSf3GwqbUw==",
+ "version": "2.1.8",
+ "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.8.tgz",
+ "integrity": "sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA==",
"devOptional": true,
"license": "MIT",
"engines": {
"node": ">=20"
},
"peerDependencies": {
- "hono": "^4"
+ "hono": "^4 || ^5.0.0-0"
}
},
"node_modules/@humanfs/core": {
@@ -4014,9 +4014,9 @@
}
},
"node_modules/hono": {
- "version": "4.13.11",
- "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.11.tgz",
- "integrity": "sha512-/SMX/RQNJn7oNmFwH6DtwDqcrzZU2otm1FD6OJe2cWF6cfy/F8hq0XVBv7xW3FTJshRQwuBnXHDq2kNsdZnshg==",
+ "version": "4.13.18",
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.18.tgz",
+ "integrity": "sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==",
"devOptional": true,
"license": "MIT",
"engines": {
diff --git a/data-migration/package.json b/data-migration/package.json
index 3fff2c8..46c15be 100644
--- a/data-migration/package.json
+++ b/data-migration/package.json
@@ -39,11 +39,11 @@
"yarn": "1.22.19"
},
"overrides": {
- "@hono/node-server": "2.1.3",
+ "@hono/node-server": "2.1.8",
"deepmerge-ts": "8.0.0",
"effect": "3.22.0",
"glob": "14.0.2",
- "hono": "4.13.11",
+ "hono": "4.13.18",
"lodash": "4.18.1",
"valibot": "1.4.2",
"mysql2": "3.23.1",
diff --git a/data-migration/src/scripts/importHistoricalMarathonMatches/descriptionSourcing.js b/data-migration/src/scripts/importHistoricalMarathonMatches/descriptionSourcing.js
index 68da35d..f9fe432 100644
--- a/data-migration/src/scripts/importHistoricalMarathonMatches/descriptionSourcing.js
+++ b/data-migration/src/scripts/importHistoricalMarathonMatches/descriptionSourcing.js
@@ -283,19 +283,19 @@ const convertRichTextSectionToMarkdown = (value) => {
.replace(/
\s*(?:<\/br>)?/gi, "\n")
.replace(/<(tt|code|type)\b[^>]*>([\s\S]*?)<\/\1>/gi, (_, __, content) => {
const inline = toInlineText(content);
- return inline ? `\`${inline}\`` : "";
+ return inline ? `\`${inline}\`` : " ";
})
.replace(/<(b|strong)\b[^>]*>([\s\S]*?)<\/\1>/gi, (_, __, content) => {
const inline = toInlineText(content);
- return inline ? `**${inline}**` : "";
+ return inline ? `**${inline}**` : " ";
})
.replace(/<(i|em)\b[^>]*>([\s\S]*?)<\/\1>/gi, (_, __, content) => {
const inline = toInlineText(content);
- return inline ? `*${inline}*` : "";
+ return inline ? `*${inline}*` : " ";
})
.replace(/]*>([\s\S]*?)<\/sup>/gi, (_, content) => {
const inline = toInlineText(content);
- return inline ? `^${inline}^` : "";
+ return inline ? `^${inline}^` : " ";
})
.replace(/]*>/gi, "\n- ")
.replace(/<\/li>/gi, "\n")
diff --git a/data-migration/test/importHistoricalMarathonMatches.descriptionSourcing.test.js b/data-migration/test/importHistoricalMarathonMatches.descriptionSourcing.test.js
index 2e59d62..aee8f37 100644
--- a/data-migration/test/importHistoricalMarathonMatches.descriptionSourcing.test.js
+++ b/data-migration/test/importHistoricalMarathonMatches.descriptionSourcing.test.js
@@ -78,4 +78,18 @@ describe("importHistoricalMarathonMatches description sourcing", () => {
source: "legacy-component-text-markdown",
});
});
+
+ test.each(["tt", "code", "type", "b", "strong", "i", "em", "sup"])(
+ "keeps a separator when an empty %s element interrupts an HTML tag",
+ (tag) => {
+ const markdown = convertComponentXmlToMarkdown(
+ `before <${tag}>${tag}>iframe src='https://evil.example'>after`
+ );
+
+ expect(markdown).toContain("before");
+ expect(markdown).toContain("after");
+ expect(markdown).toContain("iframe src='https://evil.example'>after");
+ expect(markdown).not.toMatch(/