We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca3bc6f commit 4d98e8bCopy full SHA for 4d98e8b
1 file changed
src/components/slide-renderer/EditableTextOverlay.tsx
@@ -15,6 +15,8 @@ interface TextSegment {
15
styleKey: string
16
}
17
18
+const BLOCK_LINE_TAGS = new Set(['DIV', 'P', 'LI'])
19
+
20
const defaultRunTemplate: TextRun = {
21
text: '',
22
fontFamily: 'Arial',
@@ -66,6 +68,12 @@ function extractTextRunsFromLineNode(
66
68
if (node.nodeType !== Node.ELEMENT_NODE) return
67
69
const element = node as HTMLElement
70
if (element.tagName === 'BR') {
71
+ pushSegment('\n', activeStyleKey)
72
+ return
73
+ }
74
75
+ // contentEditable 在换行编辑后可能出现嵌套块级节点,跳过它们可避免跨行文本重复采集
76
+ if (element !== lineNode && BLOCK_LINE_TAGS.has(element.tagName)) {
77
return
78
79
0 commit comments