Skip to content

Commit

Permalink
fix: format element list boundary error #367
Browse files Browse the repository at this point in the history
  • Loading branch information
Hufe921 committed Dec 20, 2023
1 parent d83fc0f commit 7a6f656
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/editor/utils/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ export function formatElementList(
...options
}
const startElement = elementList[0]
// 非首字符零宽节点文本元素则补偿
if (
isHandleFirstElement &&
startElement?.value !== ZERO &&
startElement?.value !== '\n'
((startElement?.type && startElement.type !== ElementType.TEXT) ||
(startElement?.value !== ZERO && startElement?.value !== '\n'))
) {
elementList.unshift({
value: ZERO
Expand Down

0 comments on commit 7a6f656

Please sign in to comment.