fix(export): enable proper file downloads and fix empty PNG export

This commit is contained in:
syntaxbullet
2026-02-09 22:50:25 +01:00
parent ea05b814b4
commit 8dae3578b1
5 changed files with 40 additions and 13 deletions

View File

@@ -8,6 +8,15 @@ export class AsciiExporter {
link.click();
}
static downloadText(content: string, filename: string) {
const blob = new Blob([content], { type: 'text/plain;charset=utf-8' });
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = filename;
link.click();
URL.revokeObjectURL(link.href);
}
static async copyToClipboard(text: string): Promise<void> {
if (navigator.clipboard && navigator.clipboard.writeText) {
await navigator.clipboard.writeText(text);