From daaf6e16b6027dd51af129b7ee7a511f27c7908a Mon Sep 17 00:00:00 2001 From: Sigve Hansen Date: Thu, 21 Nov 2024 17:24:12 +0100 Subject: [PATCH] chore(lyrics): cleanup button --- components/LyricsEditor.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/LyricsEditor.vue b/components/LyricsEditor.vue index 0542926a..22f89fe3 100644 --- a/components/LyricsEditor.vue +++ b/components/LyricsEditor.vue @@ -57,6 +57,12 @@ onMounted(() => { onBeforeUnmount(() => { editor.value?.destroy(); }); + +function cleanUpFormatting() { + if (!editor.value) return; + modelValue.value = lyricsCleanupHtml(editor.value.getHTML()); + editor.value.commands.setContent(modelValue.value); +}