mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
⚡ 改进重命名资源文件性能 https://github.com/siyuan-note/siyuan/issues/7322
改进建立引用索引 https://github.com/siyuan-note/siyuan/issues/7320
This commit is contained in:
parent
6743b21193
commit
b6ea32462e
23 changed files with 155 additions and 132 deletions
|
|
@ -17,14 +17,15 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
"net/http"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute"
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
|
|
@ -44,7 +45,7 @@ func appendBlock(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
if "markdown" == dataType {
|
||||
luteEngine := model.NewLute()
|
||||
luteEngine := util.NewLute()
|
||||
data = dataBlockDOM(data, luteEngine)
|
||||
}
|
||||
|
||||
|
|
@ -89,7 +90,7 @@ func prependBlock(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
if "markdown" == dataType {
|
||||
luteEngine := model.NewLute()
|
||||
luteEngine := util.NewLute()
|
||||
data = dataBlockDOM(data, luteEngine)
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +151,7 @@ func insertBlock(c *gin.Context) {
|
|||
}
|
||||
|
||||
if "markdown" == dataType {
|
||||
luteEngine := model.NewLute()
|
||||
luteEngine := util.NewLute()
|
||||
data = dataBlockDOM(data, luteEngine)
|
||||
}
|
||||
|
||||
|
|
@ -197,7 +198,7 @@ func updateBlock(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
luteEngine := model.NewLute()
|
||||
luteEngine := util.NewLute()
|
||||
if "markdown" == dataType {
|
||||
data = dataBlockDOM(data, luteEngine)
|
||||
}
|
||||
|
|
@ -217,7 +218,7 @@ func updateBlock(c *gin.Context) {
|
|||
|
||||
var transactions []*model.Transaction
|
||||
if "NodeDocument" == block.Type {
|
||||
oldTree, err := model.LoadTree(block.Box, block.Path)
|
||||
oldTree, err := filesys.LoadTree(block.Box, block.Path, luteEngine)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = "load tree failed: " + err.Error()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue