diff --git a/web/app/changelog/page.tsx b/web/app/changelog/page.tsx index 596ae5d..b67d22b 100644 --- a/web/app/changelog/page.tsx +++ b/web/app/changelog/page.tsx @@ -3,11 +3,29 @@ import path from "path" import { remark } from "remark" import html from "remark-html" +function markdownToHtml(markdown) { + return markdown + .replace(/^### (.*$)/gim, "
$1
") // Convertir `código` en
+ .replace(/^- (.*$)/gim, "- $1
") // Convertir listas en
+ .replace(/\n/g, "
") // Mantener los saltos de línea
+}
+
async function getChangelog() {
const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md")
try {
const fileContents = fs.readFileSync(changelogPath, "utf8")
- const result = await remark().use(html).process(fileContents)
+
+ // Convertimos Markdown a HTML manualmente
+ const formattedContent = markdownToHtml(fileContents)
+
+ // Usamos remark-html como último paso
+ const result = await remark().use(html).process(formattedContent)
+
return result.toString()
} catch (error) {
console.error("Error reading changelog file:", error)
@@ -22,7 +40,7 @@ export default async function ChangelogPage() {
Changelog
-
+
)