mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-18 18:10:43 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
c1036cd776
@ -6,7 +6,7 @@ require (
|
|||||||
github.com/88250/clipboard v0.1.5
|
github.com/88250/clipboard v0.1.5
|
||||||
github.com/88250/css v0.1.2
|
github.com/88250/css v0.1.2
|
||||||
github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37
|
github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37
|
||||||
github.com/88250/lute v1.7.6-0.20230329103341-8b07be5ce46e
|
github.com/88250/lute v1.7.6-0.20230330013439-8760e9c073db
|
||||||
github.com/88250/pdfcpu v0.3.14-0.20230224021324-e51076eb6390
|
github.com/88250/pdfcpu v0.3.14-0.20230224021324-e51076eb6390
|
||||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
|
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
|
||||||
github.com/ClarkThan/ahocorasick v0.0.0-20230220142845-f237b6348b3e
|
github.com/ClarkThan/ahocorasick v0.0.0-20230220142845-f237b6348b3e
|
||||||
|
@ -8,8 +8,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS
|
|||||||
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||||
github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37 h1:7ZMvlXDbH2sqaxowoAFcLjcdRN7ncVE0U1S2ukpUgac=
|
github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37 h1:7ZMvlXDbH2sqaxowoAFcLjcdRN7ncVE0U1S2ukpUgac=
|
||||||
github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k=
|
github.com/88250/gulu v1.2.3-0.20230321113152-38c4a3d73c37/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k=
|
||||||
github.com/88250/lute v1.7.6-0.20230329103341-8b07be5ce46e h1:deOjwckXrB39xDvToqxBtSspBmaQ1oKEDi406xnLNOw=
|
github.com/88250/lute v1.7.6-0.20230330013439-8760e9c073db h1:VS58OzTzimPqjiw6WQJhs9o22cQpeHyuxml57rqQXkk=
|
||||||
github.com/88250/lute v1.7.6-0.20230329103341-8b07be5ce46e/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
|
github.com/88250/lute v1.7.6-0.20230330013439-8760e9c073db/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
|
||||||
github.com/88250/pdfcpu v0.3.14-0.20230224021324-e51076eb6390 h1:q2AR33VoQ87WYtvZ4pEvwj5gZkv22HK/yMlPWwF1oyc=
|
github.com/88250/pdfcpu v0.3.14-0.20230224021324-e51076eb6390 h1:q2AR33VoQ87WYtvZ4pEvwj5gZkv22HK/yMlPWwF1oyc=
|
||||||
github.com/88250/pdfcpu v0.3.14-0.20230224021324-e51076eb6390/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
|
github.com/88250/pdfcpu v0.3.14-0.20230224021324-e51076eb6390/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
|
||||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=
|
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=
|
||||||
|
@ -1797,7 +1797,7 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
|
|||||||
if "" != exportMdVal {
|
if "" != exportMdVal {
|
||||||
luteEngine0 := util.NewLute()
|
luteEngine0 := util.NewLute()
|
||||||
luteEngine0.SetYamlFrontMatter(true) // 挂件导出属性 `data-export-md` 支持 YFM https://github.com/siyuan-note/siyuan/issues/7752
|
luteEngine0.SetYamlFrontMatter(true) // 挂件导出属性 `data-export-md` 支持 YFM https://github.com/siyuan-note/siyuan/issues/7752
|
||||||
exportMdTree := parse.Parse("", []byte(exportMdVal), luteEngine.ParseOptions)
|
exportMdTree := parse.Parse("", []byte(exportMdVal), luteEngine0.ParseOptions)
|
||||||
var insertNodes []*ast.Node
|
var insertNodes []*ast.Node
|
||||||
for c := exportMdTree.Root.FirstChild; nil != c; c = c.Next {
|
for c := exportMdTree.Root.FirstChild; nil != c; c = c.Next {
|
||||||
if ast.NodeKramdownBlockIAL != c.Type {
|
if ast.NodeKramdownBlockIAL != c.Type {
|
||||||
|
@ -134,6 +134,10 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 移动前先删除引用 https://github.com/siyuan-note/siyuan/issues/7819
|
||||||
|
sql.DeleteRefsTreeQueue(srcTree)
|
||||||
|
sql.DeleteRefsTreeQueue(targetTree)
|
||||||
|
|
||||||
if ast.NodeListItem == pivot.Type {
|
if ast.NodeListItem == pivot.Type {
|
||||||
pivot = pivot.LastChild
|
pivot = pivot.LastChild
|
||||||
}
|
}
|
||||||
|
@ -255,14 +255,18 @@ func CheckUpdate(showMsg bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ver := result["ver"].(string)
|
ver := result["ver"].(string)
|
||||||
release := result["release"].(string)
|
releaseLang := result["release"].(string)
|
||||||
|
if releaseLangArg := result["release_"+Conf.Lang]; nil != releaseLangArg {
|
||||||
|
releaseLang = releaseLangArg.(string)
|
||||||
|
}
|
||||||
|
|
||||||
var msg string
|
var msg string
|
||||||
var timeout int
|
var timeout int
|
||||||
if isVersionUpToDate(ver) {
|
if isVersionUpToDate(ver) {
|
||||||
msg = Conf.Language(10)
|
msg = Conf.Language(10)
|
||||||
timeout = 3000
|
timeout = 3000
|
||||||
} else {
|
} else {
|
||||||
msg = fmt.Sprintf(Conf.Language(9), "<a href=\""+release+"\">"+release+"</a>")
|
msg = fmt.Sprintf(Conf.Language(9), "<a href=\""+releaseLang+"\">"+releaseLang+"</a>")
|
||||||
showMsg = true
|
showMsg = true
|
||||||
timeout = 15000
|
timeout = 15000
|
||||||
}
|
}
|
||||||
|
@ -47,3 +47,13 @@ func upsertRefs(tx *sql.Tx, tree *parse.Tree) (err error) {
|
|||||||
err = insertRefs(tx, tree)
|
err = insertRefs(tx, tree)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func deleteRefs(tx *sql.Tx, tree *parse.Tree) (err error) {
|
||||||
|
if err = deleteRefsByPath(tx, tree.Box, tree.Path); nil != err {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err = deleteFileAnnotationRefsByPath(tx, tree.Box, tree.Path); nil != err {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -44,7 +44,7 @@ type dbQueueOperation struct {
|
|||||||
action string // upsert/delete/delete_id/rename/rename_sub_tree/delete_box/delete_box_refs/insert_refs/index/delete_ids/update_block_content/delete_assets
|
action string // upsert/delete/delete_id/rename/rename_sub_tree/delete_box/delete_box_refs/insert_refs/index/delete_ids/update_block_content/delete_assets
|
||||||
|
|
||||||
indexPath string // index
|
indexPath string // index
|
||||||
upsertTree *parse.Tree // upsert/insert_refs
|
upsertTree *parse.Tree // upsert/insert_refs/update_refs/delete_refs
|
||||||
removeTreeBox, removeTreePath string // delete
|
removeTreeBox, removeTreePath string // delete
|
||||||
removeTreeIDBox, removeTreeID string // delete_id
|
removeTreeIDBox, removeTreeID string // delete_id
|
||||||
removeTreeIDs []string // delete_ids
|
removeTreeIDs []string // delete_ids
|
||||||
@ -182,6 +182,8 @@ func execOp(op *dbQueueOperation, tx *sql.Tx, context map[string]interface{}) (e
|
|||||||
err = insertRefs(tx, op.upsertTree)
|
err = insertRefs(tx, op.upsertTree)
|
||||||
case "update_refs":
|
case "update_refs":
|
||||||
err = upsertRefs(tx, op.upsertTree)
|
err = upsertRefs(tx, op.upsertTree)
|
||||||
|
case "delete_refs":
|
||||||
|
err = deleteRefs(tx, op.upsertTree)
|
||||||
case "update_block_content":
|
case "update_block_content":
|
||||||
err = updateBlockContent(tx, op.block)
|
err = updateBlockContent(tx, op.block)
|
||||||
case "delete_assets":
|
case "delete_assets":
|
||||||
@ -220,6 +222,20 @@ func UpdateBlockContentQueue(block *Block) {
|
|||||||
operationQueue = append(operationQueue, newOp)
|
operationQueue = append(operationQueue, newOp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func DeleteRefsTreeQueue(tree *parse.Tree) {
|
||||||
|
dbQueueLock.Lock()
|
||||||
|
defer dbQueueLock.Unlock()
|
||||||
|
|
||||||
|
newOp := &dbQueueOperation{upsertTree: tree, inQueueTime: time.Now(), action: "delete_refs"}
|
||||||
|
for i, op := range operationQueue {
|
||||||
|
if "delete_refs" == op.action && op.upsertTree.ID == tree.ID {
|
||||||
|
operationQueue[i] = newOp
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
operationQueue = append(operationQueue, newOp)
|
||||||
|
}
|
||||||
|
|
||||||
func UpdateRefsTreeQueue(tree *parse.Tree) {
|
func UpdateRefsTreeQueue(tree *parse.Tree) {
|
||||||
dbQueueLock.Lock()
|
dbQueueLock.Lock()
|
||||||
defer dbQueueLock.Unlock()
|
defer dbQueueLock.Unlock()
|
||||||
|
@ -6,13 +6,13 @@ from collections import defaultdict
|
|||||||
import github
|
import github
|
||||||
|
|
||||||
docmap = {
|
docmap = {
|
||||||
"Feature": "引入特性",
|
"Feature": "Feature",
|
||||||
"Enhancement": "改进功能",
|
"Enhancement": "Enhancement",
|
||||||
"Bug": "修复缺陷",
|
"Bug": "Bug",
|
||||||
"Document": "文档相关",
|
"Document": "Document",
|
||||||
"Refactor": "开发重构",
|
"Refactor": "Refactor",
|
||||||
"Abolishment": "移除功能",
|
"Abolishment": "Abolishment",
|
||||||
"Development": "开发相关",
|
"Development": "Development",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user