feat: implement paste decryption

refactor: switch back to highlight.js
This commit is contained in:
2025-12-29 04:28:44 -05:00
parent a9e1e82359
commit 3a549511f9
7 changed files with 155 additions and 623 deletions
@@ -1,6 +1,5 @@
import type { PageServerLoad } from './$types';
import type { Paste } from '$lib/types/paste';
import { getShiki } from '$lib/server/shiki';
export const load: PageServerLoad = async ({ params, fetch }) => {
const { id } = params;
@@ -18,14 +17,5 @@ export const load: PageServerLoad = async ({ params, fetch }) => {
const options = await pasteOptions.json();
const content = await pasteContent.text();
let highlighted = '';
if (pasteData && content) {
const shiki = await getShiki();
highlighted = shiki.codeToHtml(content, {
lang: pasteData.syntax || 'plaintext',
theme: 'github-dark'
});
}
return { paste: pasteData, content, options, highlighted };
return { paste: pasteData, content, options };
};