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
-23
View File
@@ -1,23 +0,0 @@
import { createHighlighter } from 'shiki';
import type { Highlighter } from 'shiki';
let highlighterPromise: Promise<Highlighter> | null = null;
async function loadHighlighter() {
const res = await fetch('http://localhost:5050/api/paste/create/options');
if (!res.ok) throw new Error('Failed to fetch paste options');
const data = await res.json();
return createHighlighter({
themes: ['github-dark', 'github-light'],
langs: data.syntaxes
});
}
export function getShiki() {
if (!highlighterPromise) {
highlighterPromise = loadHighlighter();
}
return highlighterPromise;
}