mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
d579e7511f
2 changed files with 11 additions and 6 deletions
|
|
@ -269,7 +269,7 @@ func Export2Liandi(id string) (err error) {
|
|||
title := path.Base(tree.HPath)
|
||||
tags := tree.Root.IALAttr("tags")
|
||||
content := exportMarkdownContent0(tree, util.GetCloudForumAssetsServer()+time.Now().Format("2006/01")+"/siyuan/"+Conf.GetUser().UserId+"/", true,
|
||||
".md", 4, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
|
||||
".md", 3, 1, 1,
|
||||
"#", "#",
|
||||
"", "",
|
||||
false, nil, true, &map[string]*parse.Tree{})
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
|
|||
}
|
||||
}
|
||||
|
||||
destPath, parentHPath, err = getRollbackDockPath(boxID, historyPath)
|
||||
destPath, parentHPath, err = getRollbackDockPath(boxID, workingDoc)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
@ -338,10 +338,15 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
|
|||
return nil
|
||||
}
|
||||
|
||||
func getRollbackDockPath(boxID, historyPath string) (destPath, parentHPath string, err error) {
|
||||
baseName := filepath.Base(historyPath)
|
||||
parentID := path.Base(filepath.Dir(historyPath))
|
||||
parentWorkingDoc := treenode.GetBlockTree(parentID)
|
||||
func getRollbackDockPath(boxID string, workingDoc *treenode.BlockTree) (destPath, parentHPath string, err error) {
|
||||
var parentID, baseName string
|
||||
var parentWorkingDoc *treenode.BlockTree
|
||||
if nil != workingDoc {
|
||||
baseName = path.Base(workingDoc.Path)
|
||||
parentID = path.Base(path.Dir(workingDoc.Path))
|
||||
parentWorkingDoc = treenode.GetBlockTree(parentID)
|
||||
}
|
||||
|
||||
if nil != parentWorkingDoc {
|
||||
// 父路径如果是文档,则恢复到父路径下
|
||||
parentDir := strings.TrimSuffix(parentWorkingDoc.Path, ".sy")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue