From 10a4fdf1ac08b9845a1652b4182ac9924365e192 Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Fri, 14 Feb 2025 17:25:27 +0100 Subject: [PATCH] Update page.tsx --- web/web/app/changelog/page.tsx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/web/web/app/changelog/page.tsx b/web/web/app/changelog/page.tsx index 6bb3cbf..af21d47 100644 --- a/web/web/app/changelog/page.tsx +++ b/web/web/app/changelog/page.tsx @@ -2,26 +2,28 @@ import fs from "fs" import path from "path" import { remark } from "remark" import html from "remark-html" -import DocsLayout from "../components/docs-layout" async function getChangelog() { const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md") - const fileContents = fs.readFileSync(changelogPath, "utf8") - - const result = await remark().use(html).process(fileContents) - return result.toString() + try { + const fileContents = fs.readFileSync(changelogPath, "utf8") + const result = await remark() + .use(html) // No usar sanitize: false a menos que sea seguro + .process(fileContents) + return result.toString() + } catch (error) { + console.error("Error reading changelog file:", error) + return "

Changelog content not found.

" + } } export default async function ChangelogPage() { const changelogContent = await getChangelog() return ( - -
-

Changelog

-
-
- +
+

Changelog

+
+
) } -