diff --git a/web-next/app/[locale]/page.tsx b/web-next/app/[locale]/page.tsx index 28782ba..0eb527d 100644 --- a/web-next/app/[locale]/page.tsx +++ b/web-next/app/[locale]/page.tsx @@ -16,6 +16,15 @@ async function getData(): Promise<{ noticias: Noticia[]; status: ServerStatus | } } +// Sustituye la marca «UltimoWoW»/«Nova WoW» por el nombre del reino SOLO en el +// texto visible (fuera de las etiquetas < >), para no romper las URLs de los +// enlaces; respeta MAYÚSCULAS y no toca dominios «...com». +function brandify(html: string, realm: string): string { + const re = /(?:ultimo\s?wow|nova\s?wow)(?!\.com)/gi + const repl = (m: string) => (m === m.toUpperCase() ? realm.toUpperCase() : realm) + return html.replace(/<[^>]*>|[^<]+/g, (seg) => (seg.startsWith('<') ? seg : seg.replace(re, repl))) +} + function formatFecha(iso: string | Date | null): string { if (!iso) return '' const d = new Date(iso) @@ -125,11 +134,11 @@ export default async function HomePage({ params }: { params: Promise<{ locale: s <> {noticias.map((n) => (