Skip to content

Commit 2bb4e21

Browse files
committed
Fix issue with line break node breaking schema export
1 parent 6ff8578 commit 2bb4e21

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<script setup>
2+
import { ref } from 'vue';
3+
const fileInput = ref(null);
4+
5+
const props = defineProps({
6+
updateFile: {
7+
type: Function,
8+
required: true
9+
}
10+
})
11+
12+
const handleFileChange = () => {
13+
console.debug('File input changed');
14+
props.updateFile(fileInput.value.files[0]);
15+
}
16+
17+
</script>
18+
19+
<template>
20+
<div>
21+
<button class="custom-button" @click="fileInput?.click()">Import document</button>
22+
<input
23+
type="file"
24+
ref="fileInput"
25+
accept=".docx"
26+
class="hidden"
27+
@change="handleFileChange"
28+
>
29+
</div>
30+
</template>

packages/super-editor/src/extensions/line-break/line-break.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@ import { Node, Attribute } from '@core/index.js';
22

33
export const LineBreak = Node.create({
44
name: 'lineBreak',
5-
65
group: 'inline',
7-
86
inline: true,
7+
marks: '',
8+
defining: true,
9+
selectable: false,
10+
content: '',
11+
atom: true,
912

1013
parseDOM() {
1114
return [{ tag: 'br' }];
1215
},
1316

1417
renderDOM() {
15-
return ['br', {}, 0];
18+
return ['br', {}];
1619
},
1720
});
1821

0 commit comments

Comments
 (0)