From e2625219e286f04b8ad8c05855227b863c6a96f8 Mon Sep 17 00:00:00 2001 From: cosmo Date: Sun, 26 Apr 2026 19:14:39 +0200 Subject: [PATCH] fix: preserve line breaks from HTML tags during Ikonis feature description parsing --- scripts/ikonis-data.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/ikonis-data.js b/scripts/ikonis-data.js index c0def78..29cf4e5 100644 --- a/scripts/ikonis-data.js +++ b/scripts/ikonis-data.js @@ -25,8 +25,12 @@ export function getAugments() { for (const [id, feature] of Object.entries(allFeatures)) { const name = feature.label || feature.name || ""; if (name.startsWith("Ikonis:")) { - const desc = feature.description ? feature.description.replace(/<[^>]*>?/gm, '').trim() : ""; - const lines = desc.split(/\n|\r/).map(l => l.trim()).filter(l => l.length > 0); + let desc = feature.description || ""; + // Replace common line-breaking tags with actual newlines before stripping + desc = desc.replace(/<\/p>|/gi, '\n'); + desc = desc.replace(/<[^>]*>?/gm, '').trim(); + + const lines = desc.split('\n').map(l => l.trim()).filter(l => l.length > 0); const costLine = lines.find(l => l.toLowerCase().startsWith("cost:")); const effectLine = lines.find(l => !l.toLowerCase().startsWith("cost:"));