mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
ea750a32fb
2 changed files with 22 additions and 1 deletions
|
|
@ -693,7 +693,9 @@ func Close(force, setCurrentWorkspace bool, execInstallPkg int) (exitCode int) {
|
|||
go func() {
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
logging.LogInfof("exited kernel")
|
||||
util.WebSocketServer.Close()
|
||||
if nil != util.WebSocketServer {
|
||||
util.WebSocketServer.Close()
|
||||
}
|
||||
util.HttpServing = false
|
||||
os.Exit(logging.ExitCodeOk)
|
||||
}()
|
||||
|
|
|
|||
|
|
@ -439,6 +439,25 @@ func (tx *Transaction) doMove(operation *Operation) (ret *TxErr) {
|
|||
return
|
||||
}
|
||||
|
||||
if 0 < len(headingChildren) {
|
||||
// 折叠标题再编辑形成外层列表(前面加上 * )时,前端给的 tx 序列会形成死循环,在这里解开
|
||||
// Nested lists cause hang after collapsing headings https://github.com/siyuan-note/siyuan/issues/15943
|
||||
lastChild := headingChildren[len(headingChildren)-1]
|
||||
if "1" == lastChild.IALAttr("heading-fold") && ast.NodeList == lastChild.Type &&
|
||||
nil != lastChild.FirstChild && nil != lastChild.FirstChild.FirstChild && lastChild.FirstChild.FirstChild.ID == targetPreviousID {
|
||||
ast.Walk(lastChild, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||
if !entering || !n.IsBlock() {
|
||||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
n.RemoveIALAttr("heading-fold")
|
||||
n.RemoveIALAttr("fold")
|
||||
return ast.WalkContinue
|
||||
})
|
||||
headingChildren = headingChildren[:len(headingChildren)-1]
|
||||
}
|
||||
}
|
||||
|
||||
for i := len(headingChildren) - 1; -1 < i; i-- {
|
||||
c := headingChildren[i]
|
||||
targetNode.InsertAfter(c)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue