mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve duplicating doc/av https://github.com/siyuan-note/siyuan/issues/15786
This commit is contained in:
parent
d2f990a830
commit
305bd9dfb0
4 changed files with 16 additions and 3 deletions
|
|
@ -43,7 +43,7 @@ import (
|
|||
func resetTree(tree *parse.Tree, titleSuffix string, removeAvBinding bool) {
|
||||
tree.ID = ast.NewNodeID()
|
||||
tree.Root.ID = tree.ID
|
||||
|
||||
title := tree.Root.IALAttr("title")
|
||||
if "" != titleSuffix {
|
||||
if t, parseErr := time.Parse("20060102150405", util.TimeFromID(tree.ID)); nil == parseErr {
|
||||
titleSuffix += " " + t.Format("2006-01-02 15:04:05")
|
||||
|
|
@ -52,9 +52,12 @@ func resetTree(tree *parse.Tree, titleSuffix string, removeAvBinding bool) {
|
|||
}
|
||||
titleSuffix = "(" + titleSuffix + ")"
|
||||
titleSuffix = " " + titleSuffix
|
||||
if Conf.language(16) == title {
|
||||
titleSuffix = ""
|
||||
}
|
||||
}
|
||||
tree.Root.SetIALAttr("id", tree.ID)
|
||||
tree.Root.SetIALAttr("title", tree.Root.IALAttr("title")+titleSuffix)
|
||||
tree.Root.SetIALAttr("title", title+titleSuffix)
|
||||
tree.Root.RemoveIALAttr("scroll")
|
||||
p := path.Join(path.Dir(tree.Path), tree.ID) + ".sy"
|
||||
tree.Path = p
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue