Closed dev-guy closed 1 year ago
<script setup lang="ts">
import { Editor, rootCtx, defaultValueCtx, remarkStringifyOptionsCtx } from "@milkdown/core";
import { commonmark } from "@milkdown/preset-commonmark";
export let content;
function editor(dom) {
Editor.make()
.config(ctx => {
ctx.set(remarkStringifyOptionsCtx, { emphasis: '*' })
ctx.set(rootCtx, dom);
ctx.set(defaultValueCtx, content);
})
.use(commonmark)
.create();
}
</script>
<div use:editor />
Try this one
Thanks!
Initial checklist
Affected packages and versions
commonmark
Link to runnable example
https://stackblitz.com/edit/sveltejs-kit-template-default-z9sbgm?file=src%2Froutes%2FMilkdown.svelte
Steps to reproduce
SvelteKit running on Stackblitz
Go to the above URL. When you see the text "Ready," clear the editor and type:
**foo**
See also https://discord.com/channels/870181036041060352/1112047452074279062
Expected behavior
foo is displayed in bold font
Actual behavior
foo is displayed in italic font
Runtime
Chrome
OS
Other (please specify in steps to reproduce)
Build and bundle tools
Vite