We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a4562b commit 5a22c6bCopy full SHA for 5a22c6b
packages/bytemd/src/Editor.svelte
@@ -1,16 +1,22 @@
1
<script>
2
import { onMount } from 'svelte';
3
import codemirror from 'codemirror';
4
- import mdMode from 'codemirror/mode/markdown/markdown.js';
+ import 'codemirror/mode/markdown/markdown.js';
5
import Viewer from './Viewer.svelte';
6
7
window.process = { cwd: () => '/' }; // FIXME:
8
+
9
export let source;
10
+ export let codemirrorConfig;
11
12
let textarea;
13
14
onMount(() => {
15
const ed = codemirror.fromTextArea(textarea, {
- mode: 'markdown'
16
+ mode: 'markdown',
17
+ lineNumbers: true,
18
+ lineWrapping: true,
19
+ ...codemirrorConfig
20
});
21
ed.setValue(source);
22
ed.on('change', () => {
0 commit comments