Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
c1036cd776
8 changed files with 48 additions and 14 deletions
|
@ -6,7 +6,7 @@ require (
|
|||
github.com/88250/clipboard v0.1.5
|
||||
github.com/88250/css v0.1.2
|
||||
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/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
|
||||
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/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/lute v1.7.6-0.20230329103341-8b07be5ce46e h1:deOjwckXrB39xDvToqxBtSspBmaQ1oKEDi406xnLNOw=
|
||||
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 h1:VS58OzTzimPqjiw6WQJhs9o22cQpeHyuxml57rqQXkk=
|
||||
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/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
|
||||
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 {
|
||||
luteEngine0 := util.NewLute()
|
||||
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
|
||||
for c := exportMdTree.Root.FirstChild; nil != c; c = c.Next {
|
||||
if ast.NodeKramdownBlockIAL != c.Type {
|
||||
|
|
|
@ -134,6 +134,10 @@ func Doc2Heading(srcID, targetID string, after bool) (srcTreeBox, srcTreePath st
|
|||
return
|
||||
}
|
||||
|
||||
// 移动前先删除引用 https://github.com/siyuan-note/siyuan/issues/7819
|
||||
sql.DeleteRefsTreeQueue(srcTree)
|
||||
sql.DeleteRefsTreeQueue(targetTree)
|
||||
|
||||
if ast.NodeListItem == pivot.Type {
|
||||
pivot = pivot.LastChild
|
||||
}
|
||||
|
|
|
@ -255,14 +255,18 @@ func CheckUpdate(showMsg bool) {
|
|||
}
|
||||
|
||||
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 timeout int
|
||||
if isVersionUpToDate(ver) {
|
||||
msg = Conf.Language(10)
|
||||
timeout = 3000
|
||||
} 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
|
||||
timeout = 15000
|
||||
}
|
||||
|
|
|
@ -47,3 +47,13 @@ func upsertRefs(tx *sql.Tx, tree *parse.Tree) (err error) {
|
|||
err = insertRefs(tx, tree)
|
||||
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
|
||||
|
||||
indexPath string // index
|
||||
upsertTree *parse.Tree // upsert/insert_refs
|
||||
upsertTree *parse.Tree // upsert/insert_refs/update_refs/delete_refs
|
||||
removeTreeBox, removeTreePath string // delete
|
||||
removeTreeIDBox, removeTreeID string // delete_id
|
||||
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)
|
||||
case "update_refs":
|
||||
err = upsertRefs(tx, op.upsertTree)
|
||||
case "delete_refs":
|
||||
err = deleteRefs(tx, op.upsertTree)
|
||||
case "update_block_content":
|
||||
err = updateBlockContent(tx, op.block)
|
||||
case "delete_assets":
|
||||
|
@ -220,6 +222,20 @@ func UpdateBlockContentQueue(block *Block) {
|
|||
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) {
|
||||
dbQueueLock.Lock()
|
||||
defer dbQueueLock.Unlock()
|
||||
|
|
|
@ -6,13 +6,13 @@ from collections import defaultdict
|
|||
import github
|
||||
|
||||
docmap = {
|
||||
"Feature": "引入特性",
|
||||
"Enhancement": "改进功能",
|
||||
"Bug": "修复缺陷",
|
||||
"Document": "文档相关",
|
||||
"Refactor": "开发重构",
|
||||
"Abolishment": "移除功能",
|
||||
"Development": "开发相关",
|
||||
"Feature": "Feature",
|
||||
"Enhancement": "Enhancement",
|
||||
"Bug": "Bug",
|
||||
"Document": "Document",
|
||||
"Refactor": "Refactor",
|
||||
"Abolishment": "Abolishment",
|
||||
"Development": "Development",
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue