fix: preserve line breaks from HTML tags during Ikonis feature description parsing

This commit is contained in:
CPTN Cosmo 2026-04-26 19:14:39 +02:00
parent c32ebdda39
commit e2625219e2

View file

@ -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>|<br\s*\/?>/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:"));