From 72fdead9f31d22ef5a12ab441961542af7dbca03 Mon Sep 17 00:00:00 2001 From: adevopg Date: Mon, 13 Jul 2026 01:03:38 +0000 Subject: [PATCH] =?UTF-8?q?Foro:=20editor=20rico=20ligero=20(barra=20de=20?= =?UTF-8?q?formato)=20en=20respuestas,=20temas=20y=20edici=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - components/RichTextArea.tsx: barra de formato (negrita, cursiva, subrayado, tachado, enlace, cita, lista, código) que envuelve la selección del textarea en HTML; el HTML se sanea en el servidor con cleanPostHtml. Sin dependencias pesadas (evita CKEditor y no rompe el pipeline de saneado). - Cableado en ReplyForm, NewTopicForm y PostActions (edición). - i18n es/en: namespace Editor. Verificado: build OK, /forum y home 200. Co-Authored-By: Claude Opus 4.8 (1M context) --- web-next/components/NewTopicForm.tsx | 3 +- web-next/components/PostActions.tsx | 3 +- web-next/components/ReplyForm.tsx | 4 +- web-next/components/RichTextArea.tsx | 87 ++++++++++++++++++++++++++++ web-next/messages/en.json | 14 +++++ web-next/messages/es.json | 14 +++++ 6 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 web-next/components/RichTextArea.tsx diff --git a/web-next/components/NewTopicForm.tsx b/web-next/components/NewTopicForm.tsx index 1497b6c..3838f34 100644 --- a/web-next/components/NewTopicForm.tsx +++ b/web-next/components/NewTopicForm.tsx @@ -3,6 +3,7 @@ import { useState } from 'react' import { useTranslations } from 'next-intl' import { useRouter } from '@/i18n/navigation' +import { RichTextArea } from './RichTextArea' export function NewTopicForm({ forumId }: { forumId: number }) { const t = useTranslations('Forum') @@ -41,7 +42,7 @@ export function NewTopicForm({ forumId }: { forumId: number }) {

{t('newTopic')}

setName(e.target.value)} placeholder={t('newTopicName')} maxLength={200} className={field} /> -