mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-09 02:08:50 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
4554182d87
2 changed files with 16 additions and 7 deletions
|
|
@ -180,15 +180,11 @@ func (tx *Transaction) doHideAttrViewGroup(operation *Operation) (ret *TxErr) {
|
|||
func hideAttributeViewGroup(avID, blockID, groupID string, hidden int) (err error) {
|
||||
attrView, err := av.ParseAttributeView(avID)
|
||||
if err != nil {
|
||||
return err
|
||||
return
|
||||
}
|
||||
|
||||
view, err := getAttrViewViewByBlockID(attrView, blockID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if nil == view.Group {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -202,9 +198,9 @@ func hideAttributeViewGroup(avID, blockID, groupID string, hidden int) (err erro
|
|||
err = av.SaveAttributeView(attrView)
|
||||
if err != nil {
|
||||
logging.LogErrorf("save attribute view [%s] failed: %s", avID, err)
|
||||
return err
|
||||
return
|
||||
}
|
||||
return nil
|
||||
return
|
||||
}
|
||||
|
||||
func (tx *Transaction) doFoldAttrViewGroup(operation *Operation) (ret *TxErr) {
|
||||
|
|
|
|||
|
|
@ -1440,6 +1440,19 @@ func (tx *Transaction) doUpdate(operation *Operation) (ret *TxErr) {
|
|||
|
||||
cache.PutBlockIAL(updatedNode.ID, parse.IAL2Map(updatedNode.KramdownIAL))
|
||||
|
||||
if ast.NodeHTMLBlock == updatedNode.Type {
|
||||
content := string(updatedNode.Tokens)
|
||||
// 剔除连续的空行(包括空行内包含空格的情况) https://github.com/siyuan-note/siyuan/issues/15377
|
||||
var newLines []string
|
||||
lines := strings.Split(content, "\n")
|
||||
for _, line := range lines {
|
||||
if strings.TrimSpace(line) != "" {
|
||||
newLines = append(newLines, line)
|
||||
}
|
||||
}
|
||||
updatedNode.Tokens = []byte(strings.Join(newLines, "\n"))
|
||||
}
|
||||
|
||||
// 替换为新节点
|
||||
oldNode.InsertAfter(updatedNode)
|
||||
oldNode.Unlink()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue