mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 08:48:49 +01:00
This commit is contained in:
parent
05c790bea9
commit
8c980af500
1 changed files with 2 additions and 1 deletions
|
|
@ -181,7 +181,8 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
|
|||
// 段首换行
|
||||
if (editableElement.textContent !== "" && range.toString() === "" && position.start === 0) {
|
||||
let newElement;
|
||||
if (blockElement.previousElementSibling.getAttribute("data-type") === "NodeHeading" &&
|
||||
if (blockElement.previousElementSibling &&
|
||||
blockElement.previousElementSibling.getAttribute("data-type") === "NodeHeading" &&
|
||||
blockElement.previousElementSibling.getAttribute("fold") === "1") {
|
||||
newElement = genHeadingElement(blockElement.previousElementSibling, false, true) as HTMLDivElement;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue