Skip to content

Commit 41f27ee

Browse files
committed
format copied code
1 parent 528d6eb commit 41f27ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/ExportMenu/ExportMenu.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
<script>
2+
import beautify from "js-beautify";
23
import CodePreview from "$lib/CodePreview/CodePreview.svelte";
34
45
export let code
56
67
function copyCode() {
7-
navigator.clipboard.writeText(code)
8+
navigator.clipboard.writeText(beautify.js(code, {
9+
indent_size: 4,
10+
space_in_empty_paren: true,
11+
}))
812
}
913
1014
function testCode() {

0 commit comments

Comments
 (0)