Update page.tsx

This commit is contained in:
MacRimi 2025-02-15 15:40:35 +01:00 committed by GitHub
parent 5b8157149c
commit 8b3a052115
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,10 +24,10 @@ export async function generateStaticParams() {
})) }))
} }
// 🔹 Elimina las comillas de los fragmentos de código en línea dentro de <code>
function cleanInlineCode(content: string) { function cleanInlineCode(content: string) {
return content.replace(/<code>(.*?)<\/code>/g, (_, codeContent) => { return content.replace(/<code>(.*?)<\/code>/g, (_, codeContent) => {
return `<code class="bg-gray-200 text-gray-900 px-1 rounded">${codeContent}</code>` const cleanedCode = codeContent.replace(/^`|`$/g, "") // 🔹 Elimina las comillas invertidas alrededor del código
return `<code class="bg-gray-200 text-gray-900 px-1 rounded">${cleanedCode}</code>`
}) })
} }