From 8e23f8cc8c7f7b6b3b34336db9adb80345ef1f38 Mon Sep 17 00:00:00 2001 From: adevopg Date: Mon, 13 Jul 2026 13:41:48 +0000 Subject: [PATCH] web-next: noticias usan el nombre del reino en vez de UltimoWoW/NovaWoW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit brandify() sustituye «UltimoWoW»/«Nova WoW» por el nombre del reino (realmlist) en título y contenido de las noticias, SOLO en el texto visible (fuera de las etiquetas < >) para no romper las URLs de los enlaces (foro.ultimowow.com), y respetando MAYÚSCULAS (ULTIMOWOW→TRINITY, UltimoWoW→Trinity). No toca dominios. Co-Authored-By: Claude Opus 4.8 (1M context) --- web-next/app/[locale]/page.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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) => (
-

{n.titulo}

+

{brandify(n.titulo, realmName)}

{formatFecha(n.fecha)}

{n.enlace && (