refac: rich text input behaviour

This commit is contained in:
Timothy Jaeryang Baek
2024-11-23 20:31:33 -08:00
parent 5ed5e532a9
commit c567185cb1
2 changed files with 15 additions and 2 deletions
@@ -1,7 +1,10 @@
<script lang="ts">
import { marked } from 'marked';
import TurndownService from 'turndown';
const turndownService = new TurndownService();
const turndownService = new TurndownService({
codeBlockStyle: 'fenced'
});
turndownService.escape = (string) => string;
import { onMount, onDestroy } from 'svelte';
import { createEventDispatcher } from 'svelte';
@@ -154,7 +157,7 @@
const newValue = turndownService.turndown(editor.getHTML());
if (value !== newValue) {
value = newValue; // Trigger parent updates
value = newValue;
}
},
editorProps: {