From dca278d7233ba2663b5db91b1eee88cca069382f Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 28 Aug 2022 10:31:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:art:=20=E4=BD=BF=E7=94=A8=20HTML=20?= =?UTF-8?q?=E5=9D=97=E6=97=B6=E5=BB=BA=E8=AE=AE=E4=BD=BF=E7=94=A8=20`
?= =?UTF-8?q?`=20=E5=8C=85=E8=A3=B9=20HTML=20=E4=BB=A3=E7=A0=81=20https://gi?= =?UTF-8?q?thub.com/siyuan-note/siyuan/issues/5732?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/appearance/langs/en_US.json | 1 + app/appearance/langs/es_ES.json | 1 + app/appearance/langs/fr_FR.json | 1 + app/appearance/langs/zh_CHT.json | 1 + app/appearance/langs/zh_CN.json | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index df9080678..edbe77d0d 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -1,4 +1,5 @@ { + "htmlBlockTip": "Multiple HTML blocks are formed. To prevent data loss, please use <div> tags to wrap and remove blank lines", "katexMacros": "KaTex macro definition", "katexMacrosTip": "Please use JSON object format ({}) to wrap macro definitions, eg { \"\\\\foo\": \"{x^2}\" }", "systemLogTip": "Program running records are saved in the system log. By exporting the system log and sending it to developers, it can better help developers diagnose program problems", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index b37c6a3df..013e5c2e7 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -1,4 +1,5 @@ { + "htmlBlockTip": "Se forman varios bloques HTML. Para evitar la pérdida de datos, utilice etiquetas <div> para ajustar y eliminar líneas en blanco", "katexMacros": "Definición de macro de KaTex", "katexMacrosTip": "Utilice el formato de objeto JSON ({}) para envolver definiciones de macro, por ejemplo, { \"\\\\foo\": \"{x^2}\" }", "systemLogTip": "Los registros de ejecución del programa se guardan en el registro del sistema. Al exportar el registro del sistema y enviarlo a los desarrolladores, puede ayudarlos a diagnosticar mejor los problemas del programa", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 17d93720d..02f93b7c7 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -1,4 +1,5 @@ { + "htmlBlockTip": "Plusieurs blocs HTML sont formés. Pour éviter la perte de données, veuillez utiliser les balises <div> pour envelopper et supprimer les lignes vides", "katexMacros": "Définition de la macro KaTex", "katexMacrosTip": "Veuillez utiliser le format d'objet JSON ({}) pour envelopper les définitions de macro, par exemple { \"\\\\foo\": \"{x^2}\" }", "systemLogTip": "Les enregistrements en cours d'exécution du programme sont enregistrés dans le journal système. En exportant le journal système et en l'envoyant aux développeurs, cela peut mieux aider les développeurs à diagnostiquer les problèmes du programme", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index f2908c324..e74258c52 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -1,4 +1,5 @@ { + "htmlBlockTip": "形成了多個 HTML 塊,為防止數據丟失請使用 <div> 標籤包裹並去掉空行", "katexMacros": "KaTex 宏定義", "katexMacrosTip": "請使用 JSON 對象格式({})來包裹宏定義,例如 { \"\\\\foo\": \"{x^2}\" }", "systemLogTip": "系統日誌中保存了程序運行記錄,通過導出系統日誌發送給開發者可以更好地幫助開發者診斷程序問題", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index f5aea941e..4eeb6cdde 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -1,5 +1,5 @@ { - "htmlTip": "形成多个 HTML 块,为防止数据丢失请使用 <div> 标签包裹", + "htmlBlockTip": "形成了多个 HTML 块,为防止数据丢失请使用 <div> 标签包裹并去掉空行", "katexMacros": "KaTex 宏定义", "katexMacrosTip": "请使用 JSON 对象格式({})来包裹宏定义,例如 { \"\\\\foo\": \"{x^2}\" }", "systemLogTip": "系统日志中保存了程序运行记录,通过导出系统日志发送给开发者可以更好地帮助开发者诊断程序问题", From 51eedd11eb186a00afbe6c8b9abfdd8be4941146 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 28 Aug 2022 10:33:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?:art:=20=E4=BD=BF=E7=94=A8=20HTML=20?= =?UTF-8?q?=E5=9D=97=E6=97=B6=E5=BB=BA=E8=AE=AE=E4=BD=BF=E7=94=A8=20`
?= =?UTF-8?q?`=20=E5=8C=85=E8=A3=B9=20HTML=20=E4=BB=A3=E7=A0=81=20https://gi?= =?UTF-8?q?thub.com/siyuan-note/siyuan/issues/5732?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/toolbar/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index e250b7eb7..5a46e91cc 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -873,7 +873,7 @@ export class Toolbar { const tempElement = document.createElement("template"); tempElement.innerHTML = newHTML; if (tempElement.content.childElementCount > 1) { - showMessage(window.siyuan.languages.htmlTip) + showMessage(window.siyuan.languages.htmlBlockTip) } } updateTransaction(protyle, id, newHTML, html); From f9befd8d13eca6af7cbb6ada8aac1259e9e783e1 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 28 Aug 2022 10:43:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?:fire:=20=E8=A1=A8=20`blocks`=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20`fmarkdown`=20=E5=AD=97=E6=AE=B5=20https://github.c?= =?UTF-8?q?om/siyuan-note/siyuan/issues/5720?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/block.go | 51 ++++++++++++++++----------------- kernel/model/history.go | 2 +- kernel/model/search.go | 31 ++++++++++---------- kernel/sql/block.go | 43 ++++++++++++++-------------- kernel/sql/block_query.go | 6 ++-- kernel/sql/block_ref_query.go | 2 +- kernel/sql/database.go | 54 +++++++++++++++++------------------ kernel/sql/upsert.go | 9 +++--- 8 files changed, 97 insertions(+), 101 deletions(-) diff --git a/kernel/model/block.go b/kernel/model/block.go index 3978cddda..8b62d12ff 100644 --- a/kernel/model/block.go +++ b/kernel/model/block.go @@ -25,32 +25,31 @@ import ( // Block 描述了内容块。 type Block struct { - Box string `json:"box"` - Path string `json:"path"` - HPath string `json:"hPath"` - ID string `json:"id"` - RootID string `json:"rootID"` - ParentID string `json:"parentID"` - Name string `json:"name"` - Alias string `json:"alias"` - Memo string `json:"memo"` - Tag string `json:"tag"` - Content string `json:"content"` - FContent string `json:"fcontent"` - Markdown string `json:"markdown"` - FMarkdown string `json:"fmarkdown"` - Folded bool `json:"folded"` - Type string `json:"type"` - SubType string `json:"subType"` - RefText string `json:"refText"` - Defs []*Block `json:"-"` // 当前块引用了这些块,避免序列化 JSON 时产生循环引用 - Refs []*Block `json:"refs"` // 当前块被这些块引用 - DefID string `json:"defID"` - DefPath string `json:"defPath"` - IAL map[string]string `json:"ial"` - Children []*Block `json:"children"` - Depth int `json:"depth"` - Count int `json:"count"` + Box string `json:"box"` + Path string `json:"path"` + HPath string `json:"hPath"` + ID string `json:"id"` + RootID string `json:"rootID"` + ParentID string `json:"parentID"` + Name string `json:"name"` + Alias string `json:"alias"` + Memo string `json:"memo"` + Tag string `json:"tag"` + Content string `json:"content"` + FContent string `json:"fcontent"` + Markdown string `json:"markdown"` + Folded bool `json:"folded"` + Type string `json:"type"` + SubType string `json:"subType"` + RefText string `json:"refText"` + Defs []*Block `json:"-"` // 当前块引用了这些块,避免序列化 JSON 时产生循环引用 + Refs []*Block `json:"refs"` // 当前块被这些块引用 + DefID string `json:"defID"` + DefPath string `json:"defPath"` + IAL map[string]string `json:"ial"` + Children []*Block `json:"children"` + Depth int `json:"depth"` + Count int `json:"count"` } func (block *Block) IsContainerBlock() bool { diff --git a/kernel/model/history.go b/kernel/model/history.go index cc831129b..ed1e12538 100644 --- a/kernel/model/history.go +++ b/kernel/model/history.go @@ -718,7 +718,7 @@ func fullTextSearchHistory(query string, page int) (ret []*History, matchedBlock query = stringQuery(query) table := "histories_fts_case_insensitive" - projections := "type, op, title, content, path" + projections := "type, op, title, content, path, created" stmt := "SELECT " + projections + " FROM " + table + " WHERE " + table + " MATCH '{title content}:(" + query + ")'" stmt += " ORDER BY created DESC LIMIT " + strconv.Itoa(page) sqlHistories := sql.SelectHistoriesRawStmt(stmt) diff --git a/kernel/model/search.go b/kernel/model/search.go index 879508529..179bec993 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -331,6 +331,8 @@ func fullTextSearchCount(query, box, path, filter string) (matchedBlockCount, ma } func fullTextSearch(query, box, path, filter string, beforeLen int, querySyntax bool) (ret []*Block, matchedBlockCount, matchedRootCount int) { + fullTextSearchHistory(query, 1) + query = gulu.Str.RemoveInvisible(query) if util.IsIDPattern(query) { ret, matchedBlockCount, matchedRootCount = searchBySQL("SELECT * FROM `blocks` WHERE `id` = '"+query+"'", beforeLen) @@ -490,21 +492,20 @@ func fromSQLBlock(sqlBlock *sql.Block, terms string, beforeLen int) (block *Bloc markdown := maxContent(sqlBlock.Markdown, 5120) block = &Block{ - Box: sqlBlock.Box, - Path: p, - ID: id, - RootID: sqlBlock.RootID, - ParentID: sqlBlock.ParentID, - Alias: sqlBlock.Alias, - Name: sqlBlock.Name, - Memo: sqlBlock.Memo, - Tag: sqlBlock.Tag, - Content: content, - FContent: sqlBlock.FContent, - Markdown: markdown, - FMarkdown: sqlBlock.FMarkdown, - Type: treenode.FromAbbrType(sqlBlock.Type), - SubType: sqlBlock.SubType, + Box: sqlBlock.Box, + Path: p, + ID: id, + RootID: sqlBlock.RootID, + ParentID: sqlBlock.ParentID, + Alias: sqlBlock.Alias, + Name: sqlBlock.Name, + Memo: sqlBlock.Memo, + Tag: sqlBlock.Tag, + Content: content, + FContent: sqlBlock.FContent, + Markdown: markdown, + Type: treenode.FromAbbrType(sqlBlock.Type), + SubType: sqlBlock.SubType, } if "" != sqlBlock.IAL { block.IAL = map[string]string{} diff --git a/kernel/sql/block.go b/kernel/sql/block.go index 63bcc846a..f5c979c42 100644 --- a/kernel/sql/block.go +++ b/kernel/sql/block.go @@ -21,28 +21,27 @@ import ( ) type Block struct { - ID string - ParentID string - RootID string - Hash string - Box string - Path string - HPath string - Name string - Alias string - Memo string - Tag string - Content string - FContent string - Markdown string - FMarkdown string - Length int - Type string - SubType string - IAL string - Sort int - Created string - Updated string + ID string + ParentID string + RootID string + Hash string + Box string + Path string + HPath string + Name string + Alias string + Memo string + Tag string + Content string + FContent string + Markdown string + Length int + Type string + SubType string + IAL string + Sort int + Created string + Updated string } func updateRootContent(tx *sql.Tx, content, id string) { diff --git a/kernel/sql/block_query.go b/kernel/sql/block_query.go index e5cca87ad..84fd3b829 100644 --- a/kernel/sql/block_query.go +++ b/kernel/sql/block_query.go @@ -62,7 +62,7 @@ func QueryRootBlockByCondition(condition string) (ret []*Block) { for rows.Next() { var block Block var sepCount int - if err = rows.Scan(&block.ID, &block.ParentID, &block.RootID, &block.Hash, &block.Box, &block.Path, &block.HPath, &block.Name, &block.Alias, &block.Memo, &block.Tag, &block.Content, &block.FContent, &block.Markdown, &block.FMarkdown, &block.Length, &block.Type, &block.SubType, &block.IAL, &block.Sort, &block.Created, &block.Updated, &sepCount); nil != err { + if err = rows.Scan(&block.ID, &block.ParentID, &block.RootID, &block.Hash, &block.Box, &block.Path, &block.HPath, &block.Name, &block.Alias, &block.Memo, &block.Tag, &block.Content, &block.FContent, &block.Markdown, &block.Length, &block.Type, &block.SubType, &block.IAL, &block.Sort, &block.Created, &block.Updated, &sepCount); nil != err { logging.LogErrorf("query scan field failed: %s", err) return } @@ -484,7 +484,7 @@ func selectBlocksRawStmt(stmt string, limit int) (ret []*Block) { func scanBlockRows(rows *sql.Rows) (ret *Block) { var block Block - if err := rows.Scan(&block.ID, &block.ParentID, &block.RootID, &block.Hash, &block.Box, &block.Path, &block.HPath, &block.Name, &block.Alias, &block.Memo, &block.Tag, &block.Content, &block.FContent, &block.Markdown, &block.FMarkdown, &block.Length, &block.Type, &block.SubType, &block.IAL, &block.Sort, &block.Created, &block.Updated); nil != err { + if err := rows.Scan(&block.ID, &block.ParentID, &block.RootID, &block.Hash, &block.Box, &block.Path, &block.HPath, &block.Name, &block.Alias, &block.Memo, &block.Tag, &block.Content, &block.FContent, &block.Markdown, &block.Length, &block.Type, &block.SubType, &block.IAL, &block.Sort, &block.Created, &block.Updated); nil != err { logging.LogErrorf("query scan field failed: %s\n%s", err, logging.ShortStack()) return } @@ -494,7 +494,7 @@ func scanBlockRows(rows *sql.Rows) (ret *Block) { func scanBlockRow(row *sql.Row) (ret *Block) { var block Block - if err := row.Scan(&block.ID, &block.ParentID, &block.RootID, &block.Hash, &block.Box, &block.Path, &block.HPath, &block.Name, &block.Alias, &block.Memo, &block.Tag, &block.Content, &block.FContent, &block.Markdown, &block.FMarkdown, &block.Length, &block.Type, &block.SubType, &block.IAL, &block.Sort, &block.Created, &block.Updated); nil != err { + if err := row.Scan(&block.ID, &block.ParentID, &block.RootID, &block.Hash, &block.Box, &block.Path, &block.HPath, &block.Name, &block.Alias, &block.Memo, &block.Tag, &block.Content, &block.FContent, &block.Markdown, &block.Length, &block.Type, &block.SubType, &block.IAL, &block.Sort, &block.Created, &block.Updated); nil != err { if sql.ErrNoRows != err { logging.LogErrorf("query scan field failed: %s\n%s", err, logging.ShortStack()) } diff --git a/kernel/sql/block_ref_query.go b/kernel/sql/block_ref_query.go index ce4b4a517..9d7d3425b 100644 --- a/kernel/sql/block_ref_query.go +++ b/kernel/sql/block_ref_query.go @@ -375,7 +375,7 @@ func DefRefs(condition string) (ret []map[*Block]*Block) { for rows.Next() { var ref Block var rel string - if err = rows.Scan(&ref.ID, &ref.ParentID, &ref.RootID, &ref.Hash, &ref.Box, &ref.Path, &ref.HPath, &ref.Name, &ref.Alias, &ref.Memo, &ref.Tag, &ref.Content, &ref.FContent, &ref.Markdown, &ref.FMarkdown, &ref.Length, &ref.Type, &ref.SubType, &ref.IAL, &ref.Sort, &ref.Created, &ref.Updated, + if err = rows.Scan(&ref.ID, &ref.ParentID, &ref.RootID, &ref.Hash, &ref.Box, &ref.Path, &ref.HPath, &ref.Name, &ref.Alias, &ref.Memo, &ref.Tag, &ref.Content, &ref.FContent, &ref.Markdown, &ref.Length, &ref.Type, &ref.SubType, &ref.IAL, &ref.Sort, &ref.Created, &ref.Updated, &rel); nil != err { logging.LogErrorf("query scan field failed: %s", err) return diff --git a/kernel/sql/database.go b/kernel/sql/database.go index d773c0a68..b1d4d57f5 100644 --- a/kernel/sql/database.go +++ b/kernel/sql/database.go @@ -99,19 +99,19 @@ func initDBTables() { setDatabaseVer() db.Exec("DROP TABLE blocks") - _, err = db.Exec("CREATE TABLE blocks (id, parent_id, root_id, hash, box, path, hpath, name, alias, memo, tag, content, fcontent, markdown, fmarkdown, length, type, subtype, ial, sort, created, updated)") + _, err = db.Exec("CREATE TABLE blocks (id, parent_id, root_id, hash, box, path, hpath, name, alias, memo, tag, content, fcontent, markdown, length, type, subtype, ial, sort, created, updated)") if nil != err { logging.LogFatalf("create table [blocks] failed: %s", err) } db.Exec("DROP TABLE blocks_fts") - _, err = db.Exec("CREATE VIRTUAL TABLE blocks_fts USING fts5(id UNINDEXED, parent_id UNINDEXED, root_id UNINDEXED, hash UNINDEXED, box UNINDEXED, path UNINDEXED, hpath, name, alias, memo, tag, content, fcontent, markdown UNINDEXED, fmarkdown UNINDEXED, length UNINDEXED, type UNINDEXED, subtype UNINDEXED, ial, sort UNINDEXED, created UNINDEXED, updated UNINDEXED, tokenize=\"siyuan\")") + _, err = db.Exec("CREATE VIRTUAL TABLE blocks_fts USING fts5(id UNINDEXED, parent_id UNINDEXED, root_id UNINDEXED, hash UNINDEXED, box UNINDEXED, path UNINDEXED, hpath, name, alias, memo, tag, content, fcontent, markdown UNINDEXED, length UNINDEXED, type UNINDEXED, subtype UNINDEXED, ial, sort UNINDEXED, created UNINDEXED, updated UNINDEXED, tokenize=\"siyuan\")") if nil != err { logging.LogFatalf("create table [blocks_fts] failed: %s", err) } db.Exec("DROP TABLE blocks_fts_case_insensitive") - _, err = db.Exec("CREATE VIRTUAL TABLE blocks_fts_case_insensitive USING fts5(id UNINDEXED, parent_id UNINDEXED, root_id UNINDEXED, hash UNINDEXED, box UNINDEXED, path UNINDEXED, hpath, name, alias, memo, tag, content, fcontent, markdown UNINDEXED, fmarkdown UNINDEXED, length UNINDEXED, type UNINDEXED, subtype UNINDEXED, ial, sort UNINDEXED, created UNINDEXED, updated UNINDEXED, tokenize=\"siyuan case_insensitive\")") + _, err = db.Exec("CREATE VIRTUAL TABLE blocks_fts_case_insensitive USING fts5(id UNINDEXED, parent_id UNINDEXED, root_id UNINDEXED, hash UNINDEXED, box UNINDEXED, path UNINDEXED, hpath, name, alias, memo, tag, content, fcontent, markdown UNINDEXED, length UNINDEXED, type UNINDEXED, subtype UNINDEXED, ial, sort UNINDEXED, created UNINDEXED, updated UNINDEXED, tokenize=\"siyuan case_insensitive\")") if nil != err { logging.LogFatalf("create table [blocks_fts_case_insensitive] failed: %s", err) } @@ -712,19 +712,18 @@ func buildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block, attributes memo := html.UnescapeString(n.IALAttr("memo")) tag := tagFromNode(n) - var content, fcontent, markdown, fmarkdown, parentID string + var content, fcontent, markdown, parentID string ialContent := treenode.IALStr(n) hash := treenode.NodeHash(n, tree, luteEngine) var length int if ast.NodeDocument == n.Type { content = n.IALAttr("title") fcontent = content - fmarkdown = content length = utf8.RuneCountInString(fcontent) } else if n.IsContainerBlock() { markdown, content = treenode.NodeStaticMdContent(n, luteEngine) fc := treenode.FirstLeafBlock(n) - fmarkdown, fcontent = treenode.NodeStaticMdContent(fc, luteEngine) + fcontent = treenode.NodeStaticContent(fc) parentID = n.Parent.ID // 将标题块作为父节点 if h := heading(n); nil != h { @@ -742,28 +741,27 @@ func buildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block, attributes } block = &Block{ - ID: n.ID, - ParentID: parentID, - RootID: rootID, - Hash: hash, - Box: boxID, - Path: p, - HPath: tree.HPath, - Name: name, - Alias: alias, - Memo: memo, - Tag: tag, - Content: content, - FContent: fcontent, - Markdown: markdown, - FMarkdown: fmarkdown, - Length: length, - Type: treenode.TypeAbbr(n.Type.String()), - SubType: treenode.SubTypeAbbr(n), - IAL: ialContent, - Sort: nSort(n), - Created: util.TimeFromID(n.ID), - Updated: n.IALAttr("updated"), + ID: n.ID, + ParentID: parentID, + RootID: rootID, + Hash: hash, + Box: boxID, + Path: p, + HPath: tree.HPath, + Name: name, + Alias: alias, + Memo: memo, + Tag: tag, + Content: content, + FContent: fcontent, + Markdown: markdown, + Length: length, + Type: treenode.TypeAbbr(n.Type.String()), + SubType: treenode.SubTypeAbbr(n), + IAL: ialContent, + Sort: nSort(n), + Created: util.TimeFromID(n.ID), + Updated: n.IALAttr("updated"), } attrs := parse.IAL2Map(n.KramdownIAL) diff --git a/kernel/sql/upsert.go b/kernel/sql/upsert.go index 20e6b920f..643ea1be4 100644 --- a/kernel/sql/upsert.go +++ b/kernel/sql/upsert.go @@ -48,10 +48,10 @@ func InsertRefs(tx *sql.Tx, tree *parse.Tree) { } const ( - BlocksInsert = "INSERT INTO blocks (id, parent_id, root_id, hash, box, path, hpath, name, alias, memo, tag, content, fcontent, markdown, fmarkdown, length, type, subtype, ial, sort, created, updated) VALUES %s" - BlocksFTSInsert = "INSERT INTO blocks_fts (id, parent_id, root_id, hash, box, path, hpath, name, alias, memo, tag, content, fcontent, markdown, fmarkdown, length, type, subtype, ial, sort, created, updated) VALUES %s" - BlocksFTSCaseInsensitiveInsert = "INSERT INTO blocks_fts_case_insensitive (id, parent_id, root_id, hash, box, path, hpath, name, alias, memo, tag, content, fcontent, markdown, fmarkdown, length, type, subtype, ial, sort, created, updated) VALUES %s" - BlocksPlaceholder = "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" + BlocksInsert = "INSERT INTO blocks (id, parent_id, root_id, hash, box, path, hpath, name, alias, memo, tag, content, fcontent, markdown, length, type, subtype, ial, sort, created, updated) VALUES %s" + BlocksFTSInsert = "INSERT INTO blocks_fts (id, parent_id, root_id, hash, box, path, hpath, name, alias, memo, tag, content, fcontent, markdown, length, type, subtype, ial, sort, created, updated) VALUES %s" + BlocksFTSCaseInsensitiveInsert = "INSERT INTO blocks_fts_case_insensitive (id, parent_id, root_id, hash, box, path, hpath, name, alias, memo, tag, content, fcontent, markdown, length, type, subtype, ial, sort, created, updated) VALUES %s" + BlocksPlaceholder = "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" SpansInsert = "INSERT INTO spans (id, block_id, root_id, box, path, content, markdown, type, ial) VALUES %s" SpansPlaceholder = "(?, ?, ?, ?, ?, ?, ?, ?, ?)" @@ -106,7 +106,6 @@ func insertBlocks0(tx *sql.Tx, bulk []*Block) (err error) { valueArgs = append(valueArgs, b.Content) valueArgs = append(valueArgs, b.FContent) valueArgs = append(valueArgs, b.Markdown) - valueArgs = append(valueArgs, b.FMarkdown) valueArgs = append(valueArgs, b.Length) valueArgs = append(valueArgs, b.Type) valueArgs = append(valueArgs, b.SubType)