mirror of
https://github.com/SrIzan10/spongebin.git
synced 2026-05-01 11:05:09 +00:00
fix: fix the codeblock preview hopefully
This commit is contained in:
@@ -39,13 +39,13 @@ export async function generateMetadata({ params }: Props) {
|
||||
};
|
||||
|
||||
const numLines = paste.content.split("\n").length;
|
||||
const codeblockPreview = paste.content
|
||||
const codeblockContent = paste.content
|
||||
.split("\n")
|
||||
.slice(0, 3)
|
||||
.join("\n")
|
||||
.replace(/`/g, "\\`")
|
||||
.replace(/^\s*```(\w+)?/, "```" + paste.language)
|
||||
.replace(/^\s*```/, "```");
|
||||
.replace(/`/g, "\\`");
|
||||
|
||||
const codeblockPreview = `\`\`\`${paste.language}\n${codeblockContent}\n\`\`\``;
|
||||
|
||||
return {
|
||||
title: `spongebin • ${paste.id}`,
|
||||
|
||||
Reference in New Issue
Block a user