diff --git a/app/changelogs/v3.1.14/v3.1.14.md b/app/changelogs/v3.1.14/v3.1.14.md new file mode 100644 index 000000000..764bd2f43 --- /dev/null +++ b/app/changelogs/v3.1.14/v3.1.14.md @@ -0,0 +1,65 @@ +## Overview + +This version improves a lot of details and optimizes data synchronization performance. + +## Changelogs + +Below are the detailed changes in this version. + +### Enhancement + +* [Support creating new entries when filling in the database relation field](https://github.com/siyuan-note/siyuan/issues/10914) +* [The right-click menu of multiple selected documents or blocks supports more copy options](https://github.com/siyuan-note/siyuan/issues/11561) +* [Improved spacing and width of horizontal layouts](https://github.com/siyuan-note/siyuan/issues/12318) +* [Improve image width setting](https://github.com/siyuan-note/siyuan/issues/12516) +* [Support dragging assets to the database and assets field in the attribute panel](https://github.com/siyuan-note/siyuan/issues/12904) +* [Improve line breaking behavior when sublists contain lists and normal blocks](https://github.com/siyuan-note/siyuan/issues/13016) +* [Maintain block position after editor width resize](https://github.com/siyuan-note/siyuan/issues/13127) +* [Doc tree "Copy" supports using shortcut keys](https://github.com/siyuan-note/siyuan/issues/13128) +* [For flashcard blocks without fill-in-the-blank cards created, cancel "Show Answer"](https://github.com/siyuan-note/siyuan/issues/13163) +* [Improve dragging of headings or list items to the doc tree](https://github.com/siyuan-note/siyuan/issues/13170) +* [Improve search highlighting](https://github.com/siyuan-note/siyuan/issues/13178) +* [Drag and Alt+drag on the document tree swapped](https://github.com/siyuan-note/siyuan/issues/13181) +* [The database supports calculating the "Percent unique values" of the field](https://github.com/siyuan-note/siyuan/issues/13192) +* [Improve file history UI](https://github.com/siyuan-note/siyuan/issues/13193) +* [Improve inline elements find-replace](https://github.com/siyuan-note/siyuan/issues/13200) +* [Lazy loading of images and IFrames](https://github.com/siyuan-note/siyuan/issues/13204) +* [Improve data sync performance](https://github.com/siyuan-note/siyuan/issues/13216) +* [Add statistics on selected blocks and total blocks](https://github.com/siyuan-note/siyuan/issues/13235) +* [Improve cursor position after undo](https://github.com/siyuan-note/siyuan/issues/13244) +* [Improve importing Markdown](https://github.com/siyuan-note/siyuan/issues/13245) +* [Improve database attribute panel style](https://github.com/siyuan-note/siyuan/pull/13248) +* [Improve HTML clipping](https://github.com/siyuan-note/siyuan/issues/13270) +* [Improve pasting and copying of code block after select all](https://github.com/siyuan-note/siyuan/pull/13271) +* [Improve exporting Markdown](https://github.com/siyuan-note/siyuan/issues/13273) +* [Special characters in exported file names are replaced by `_`](https://github.com/siyuan-note/siyuan/issues/13274) +* [Improve drag block highlighting](https://github.com/siyuan-note/siyuan/pull/13281) +* [Improve exporting block ref](https://github.com/siyuan-note/siyuan/issues/13283) +* [Improve drag block to database highlighting](https://github.com/siyuan-note/siyuan/pull/13284) +* [Graph nodes no longer display memos](https://github.com/siyuan-note/siyuan/issues/13287) +* [Remove Unicode PUA characters](https://github.com/siyuan-note/siyuan/issues/13291) + +### Bugfix + +* [Incorrect backlink keyword highlighting](https://github.com/siyuan-note/siyuan/issues/13210) +* [Failed to purge cloud repo](https://github.com/siyuan-note/siyuan/issues/13243) +* [Undo exception after deleting some blocks](https://github.com/siyuan-note/siyuan/issues/13254) + +### Refactor + +* [Upgrade to Mermaid v11.4.0](https://github.com/siyuan-note/siyuan/issues/13209) +* [Upgrade flowchart.js to v1.18.0](https://github.com/siyuan-note/siyuan/issues/13276) +* [Upgrade pdfcpu to v0.9.1](https://github.com/siyuan-note/siyuan/issues/13305) +* [Upgrade FSRS to v3.3.0](https://github.com/siyuan-note/siyuan/issues/13323) + +### Development + +* [Compatible with line breaking behavior after setting the maximum height of code blocks](https://github.com/siyuan-note/siyuan/issues/12726) +* [Improve kernel API `/api/block/getBlockKramdown`](https://github.com/siyuan-note/siyuan/issues/13183) +* [Support toolbar configuration hotkeys returned by `updateProtyleToolbar`](https://github.com/siyuan-note/siyuan/issues/13277) +* [Kernel serve CalDAV service on path `/caldav/`](https://github.com/siyuan-note/siyuan/pull/13321) + +## Download + +* [B3log](https://b3log.org/siyuan/en/download.html) +* [GitHub](https://github.com/siyuan-note/siyuan/releases) diff --git a/app/changelogs/v3.1.14/v3.1.14_zh_CHT.md b/app/changelogs/v3.1.14/v3.1.14_zh_CHT.md new file mode 100644 index 000000000..3217269e1 --- /dev/null +++ b/app/changelogs/v3.1.14/v3.1.14_zh_CHT.md @@ -0,0 +1,65 @@ +## 概述 + +此版本改進了大量細節,優化了資料同步效能。 + +## 變更記錄 + +以下是此版本中的詳細變更。 + +### 改進功能 + +* [支援在填寫資料庫關係欄位時建立新條目](https://github.com/siyuan-note/siyuan/issues/10914) +* [右鍵選單支援對多個選取文件或區塊進行更多複製選項](https://github.com/siyuan-note/siyuan/issues/11561) +* [改進水平佈局的間距和寬度](https://github.com/siyuan-note/siyuan/issues/12318) +* [改進圖片寬度設定](https://github.com/siyuan-note/siyuan/issues/12516) +* [支援將資源檔案拖曳到資料庫和屬性面板中的資源欄位](https://github.com/siyuan-note/siyuan/issues/12904) +* [改進子清單包含清單和普通區塊時的換行行為](https://github.com/siyuan-note/siyuan/issues/13016) +* [調整編輯器寬度後保持塊位置](https://github.com/siyuan-note/siyuan/issues/13127) +* [文件樹「複製」支援使用快速鍵](https://github.com/siyuan-note/siyuan/issues/13128) +* [對於沒有建立填空卡片的閃卡區塊取消「顯示答案」](https://github.com/siyuan-note/siyuan/issues/13163) +* [改進將標題或清單項目拖曳到文件樹](https://github.com/siyuan-note/siyuan/issues/13170) +* [改進搜尋高亮](https://github.com/siyuan-note/siyuan/issues/13178) +* [交換文件樹上的 拖曳 和 Alt+拖曳](https://github.com/siyuan-note/siyuan/issues/13181) +* [資料庫支援計算欄位的「唯一值百分比」](https://github.com/siyuan-note/siyuan/issues/13192) +* [改進文件歷史介面](https://github.com/siyuan-note/siyuan/issues/13193) +* [改進行級元素查找替換](https://github.com/siyuan-note/siyuan/issues/13200) +* [圖片與 IFrame 使用延遲載入](https://github.com/siyuan-note/siyuan/issues/13204) +* [改進資料同步效能](https://github.com/siyuan-note/siyuan/issues/13216) +* [新增選取區塊和總區塊的統計](https://github.com/siyuan-note/siyuan/issues/13235) +* [改進撤銷後的遊標位置](https://github.com/siyuan-note/siyuan/issues/13244) +* [改進導入 Markdown](https://github.com/siyuan-note/siyuan/issues/13245) +* [改進資料庫屬性面板樣式](https://github.com/siyuan-note/siyuan/pull/13248) +* [改進 HTML 剪藏](https://github.com/siyuan-note/siyuan/issues/13270) +* [改進全選後貼上和複製程式碼區塊](https://github.com/siyuan-note/siyuan/pull/13271) +* [改進匯出 Markdown](https://github.com/siyuan-note/siyuan/issues/13273) +* [匯出檔案名稱中的特殊字元替換為`_`](https://github.com/siyuan-note/siyuan/issues/13274) +* [改良拖曳塊高亮](https://github.com/siyuan-note/siyuan/pull/13281) +* [改進導出區塊引用](https://github.com/siyuan-note/siyuan/issues/13283) +* [改進拖曳區塊到資料庫高亮](https://github.com/siyuan-note/siyuan/pull/13284) +* [關係圖節點不再顯示備註](https://github.com/siyuan-note/siyuan/issues/13287) +* [移除 Unicode PUA 字元](https://github.com/siyuan-note/siyuan/issues/13291) + +### 修復缺陷 + +* [反向連結關鍵字高亮不正確](https://github.com/siyuan-note/siyuan/issues/13210) +* [清理雲端倉庫失敗](https://github.com/siyuan-note/siyuan/issues/13243) +* [刪除某些區塊後撤銷異常](https://github.com/siyuan-note/siyuan/issues/13254) + +### 開發重構 + +* [升級至 Mermaid v11.4.0](https://github.com/siyuan-note/siyuan/issues/13209) +* [升級 flowchart.js v1.18.0](https://github.com/siyuan-note/siyuan/issues/13276) +* [升級 pdfcpu v0.9.1](https://github.com/siyuan-note/siyuan/issues/13305) +* [升級 FSRS v3.3.0](https://github.com/siyuan-note/siyuan/issues/13323) + +### 開發者 + +* [相容於設定程式碼區塊最大高度後的換行行為](https://github.com/siyuan-note/siyuan/issues/12726) +* [改進內核 API `/api/block/getBlockKramdown`](https://github.com/siyuan-note/siyuan/issues/13183) +* [支援由 `updateProtyleToolbar` 傳回的工具列配置熱鍵](https://github.com/siyuan-note/siyuan/issues/13277) +* [內核在路徑 `/caldav/` 提供 CalDAV 服務](https://github.com/siyuan-note/siyuan/pull/13321) + +## 下載 + +* [B3log](https://b3log.org/siyuan/download.html) +* [GitHub](https://github.com/siyuan-note/siyuan/releases) diff --git a/app/changelogs/v3.1.14/v3.1.14_zh_CN.md b/app/changelogs/v3.1.14/v3.1.14_zh_CN.md new file mode 100644 index 000000000..2cf72d635 --- /dev/null +++ b/app/changelogs/v3.1.14/v3.1.14_zh_CN.md @@ -0,0 +1,65 @@ +## 概述 + +该版本改进了大量细节,优化了数据同步性能。 + +## 变更记录 + +以下是此版本中的详细变更。 + +### 改进功能 + +* [支持在填写数据库关系字段时创建新条目](https://github.com/siyuan-note/siyuan/issues/10914) +* [右键菜单支持对多个选中文档或块进行更多复制选项](https://github.com/siyuan-note/siyuan/issues/11561) +* [改进水平布局的间距和宽度](https://github.com/siyuan-note/siyuan/issues/12318) +* [改进图片宽度设置](https://github.com/siyuan-note/siyuan/issues/12516) +* [支持将资源文件拖动到数据库和属性面板中的资源字段](https://github.com/siyuan-note/siyuan/issues/12904) +* [改进子列表包含列表和普通块时的换行行为](https://github.com/siyuan-note/siyuan/issues/13016) +* [调整编辑器宽度后保持块位置](https://github.com/siyuan-note/siyuan/issues/13127) +* [文档树“复制”支持使用快捷键](https://github.com/siyuan-note/siyuan/issues/13128) +* [对于没有创建填空卡片的闪卡块取消“显示答案”](https://github.com/siyuan-note/siyuan/issues/13163) +* [改进将标题或列表项拖动到文档树](https://github.com/siyuan-note/siyuan/issues/13170) +* [改进搜索高亮](https://github.com/siyuan-note/siyuan/issues/13178) +* [交换文档树上的 拖动 和 Alt+拖动](https://github.com/siyuan-note/siyuan/issues/13181) +* [数据库支持计算字段的“唯一值百分比”](https://github.com/siyuan-note/siyuan/issues/13192) +* [改进文件历史界面](https://github.com/siyuan-note/siyuan/issues/13193) +* [改进行级元素查找替换](https://github.com/siyuan-note/siyuan/issues/13200) +* [图片和 IFrame 使用延迟加载](https://github.com/siyuan-note/siyuan/issues/13204) +* [改进数据同步性能](https://github.com/siyuan-note/siyuan/issues/13216) +* [添加选中块和总块的统计](https://github.com/siyuan-note/siyuan/issues/13235) +* [改进撤销后的光标位置](https://github.com/siyuan-note/siyuan/issues/13244) +* [改进导入 Markdown](https://github.com/siyuan-note/siyuan/issues/13245) +* [改进数据库属性面板样式](https://github.com/siyuan-note/siyuan/pull/13248) +* [改进 HTML 剪藏](https://github.com/siyuan-note/siyuan/issues/13270) +* [改进全选后粘贴和复制代码块](https://github.com/siyuan-note/siyuan/pull/13271) +* [改进导出 Markdown](https://github.com/siyuan-note/siyuan/issues/13273) +* [导出文件名中的特殊字符替换为`_`](https://github.com/siyuan-note/siyuan/issues/13274) +* [改进拖动块高亮](https://github.com/siyuan-note/siyuan/pull/13281) +* [改进导出块引用](https://github.com/siyuan-note/siyuan/issues/13283) +* [改进拖动块到数据库高亮](https://github.com/siyuan-note/siyuan/pull/13284) +* [关系图节点不再显示备注](https://github.com/siyuan-note/siyuan/issues/13287) +* [移除 Unicode PUA 字符](https://github.com/siyuan-note/siyuan/issues/13291) + +### 修复缺陷 + +* [反向链接关键词高亮不正确](https://github.com/siyuan-note/siyuan/issues/13210) +* [清理云端仓库失败](https://github.com/siyuan-note/siyuan/issues/13243) +* [删除某些块后撤销异常](https://github.com/siyuan-note/siyuan/issues/13254) + +### 开发重构 + +* [升级到 Mermaid v11.4.0](https://github.com/siyuan-note/siyuan/issues/13209) +* [升级 flowchart.js v1.18.0](https://github.com/siyuan-note/siyuan/issues/13276) +* [升级 pdfcpu v0.9.1](https://github.com/siyuan-note/siyuan/issues/13305) +* [升级 FSRS v3.3.0](https://github.com/siyuan-note/siyuan/issues/13323) + +### 开发者 + +* [兼容设置代码块最大高度后的换行行为](https://github.com/siyuan-note/siyuan/issues/12726) +* [改进内核 API `/api/block/getBlockKramdown`](https://github.com/siyuan-note/siyuan/issues/13183) +* [支持由 `updateProtyleToolbar` 返回的工具栏配置热键](https://github.com/siyuan-note/siyuan/issues/13277) +* [内核在路径 `/caldav/` 提供 CalDAV 服务](https://github.com/siyuan-note/siyuan/pull/13321) + +## 下载 + +* [B3log](https://b3log.org/siyuan/download.html) +* [GitHub](https://github.com/siyuan-note/siyuan/releases) diff --git a/kernel/go.mod b/kernel/go.mod index 3858b0b3b..214309e8e 100644 --- a/kernel/go.mod +++ b/kernel/go.mod @@ -10,7 +10,7 @@ require ( github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48 github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7 github.com/88250/gulu v1.2.3-0.20241127120230-1ae6a9868a2d - github.com/88250/lute v1.7.7-0.20241201152142-83b4fa17beb1 + github.com/88250/lute v1.7.7-0.20241202034509-ac239093024e github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4 github.com/ConradIrwin/font v0.0.0-20240627033111-8567075b2bfe diff --git a/kernel/go.sum b/kernel/go.sum index 951f1b2ba..c3c6b5b77 100644 --- a/kernel/go.sum +++ b/kernel/go.sum @@ -14,8 +14,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/88250/gulu v1.2.3-0.20241127120230-1ae6a9868a2d h1:dexFyk3UkR4c2xpyrC4Zk4L28xFbfLYAeowIW/7QYEA= github.com/88250/gulu v1.2.3-0.20241127120230-1ae6a9868a2d/go.mod h1:MUfzyfmbPrRDZLqxc7aPrVYveatTHRfoUa5TynPS0i8= -github.com/88250/lute v1.7.7-0.20241201152142-83b4fa17beb1 h1:Aq2DO8bWUysxUSxznIGUqUYNPc4mAKKdFenbwi7XmQ4= -github.com/88250/lute v1.7.7-0.20241201152142-83b4fa17beb1/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk= +github.com/88250/lute v1.7.7-0.20241202034509-ac239093024e h1:1zdZ4qBtvQZSBEa8TfFBNP3I8EtsfvYeRcfue0itHEI= +github.com/88250/lute v1.7.7-0.20241202034509-ac239093024e/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk= github.com/88250/pdfcpu v0.3.14-0.20241201033812-5a93b7586a01 h1:AcFe63RXjIh1XtX/dc4Es3U8bYKjlEkvavHd1nFBOHM= github.com/88250/pdfcpu v0.3.14-0.20241201033812-5a93b7586a01/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI= github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY= diff --git a/kernel/model/export.go b/kernel/model/export.go index 4d69dfc8a..cf444f478 100644 --- a/kernel/model/export.go +++ b/kernel/model/export.go @@ -565,9 +565,15 @@ func ExportResources(resourcePaths []string, mainName string) (exportFilePath st } func Preview(id string) (retStdHTML string) { + blockRefMode := Conf.Export.BlockRefMode + if 5 == blockRefMode { + // 如果用户设置的块引导出模式是哈希锚点(5)则将其强制设置脚注(4)https://github.com/siyuan-note/siyuan/issues/13283 + blockRefMode = 4 + } + tree, _ := LoadTreeByBlockID(id) tree = exportTree(tree, false, false, true, - Conf.Export.BlockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode, + blockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode, Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker, Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight, Conf.Export.AddTitle) @@ -671,7 +677,7 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string blockRefMode := Conf.Export.BlockRefMode if docx { if 5 == blockRefMode { - // 导出 HTML/Word 时如果用户设置的块引导出模式是哈希锚点(5)则将其强制设置脚注(4)https://github.com/siyuan-note/siyuan/issues/13283 + // 如果用户设置的块引导出模式是哈希锚点(5)则将其强制设置脚注(4)https://github.com/siyuan-note/siyuan/issues/13283 blockRefMode = 4 } } @@ -755,14 +761,13 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string } } - luteEngine := NewLute() - luteEngine.SetFootnotes(true) - md := treenode.FormatNode(tree.Root, luteEngine) - tree = parse.Parse("", []byte(md), luteEngine.ParseOptions) if docx { processIFrame(tree) } + luteEngine := NewLute() + luteEngine.SetFootnotes(true) + // 自定义表情图片地址去掉开头的 / ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus { if !entering { @@ -827,7 +832,7 @@ func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, do } if 5 == blockRefMode { - // 导出 PDF 时如果用户设置的块引导出模式是哈希锚点(5)则将其强制设置脚注(4)https://github.com/siyuan-note/siyuan/issues/13283 + // 如果用户设置的块引导出模式是哈希锚点(5)则将其强制设置脚注(4)https://github.com/siyuan-note/siyuan/issues/13283 blockRefMode = 4 } } @@ -864,7 +869,6 @@ func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, do } } - luteEngine := NewLute() if !pdf && "" != savePath { // 导出 HTML 需要复制静态资源 srcs := []string{"stage/build/export", "stage/build/fonts", "stage/protyle"} for _, src := range srcs { @@ -916,6 +920,7 @@ func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, do processIFrame(tree) } + luteEngine := NewLute() luteEngine.SetFootnotes(true) luteEngine.RenderOptions.ProtyleContenteditable = false luteEngine.SetProtyleMarkNetImg(false) diff --git a/kernel/sql/block_query.go b/kernel/sql/block_query.go index 7ba9287c6..578f4300a 100644 --- a/kernel/sql/block_query.go +++ b/kernel/sql/block_query.go @@ -780,6 +780,9 @@ func GetBlock(id string) (ret *Block) { return } row := queryRow("SELECT * FROM blocks WHERE id = ?", id) + if nil == row { + return + } ret = scanBlockRow(row) if nil != ret { putBlockCache(ret) diff --git a/kernel/sql/stat.go b/kernel/sql/stat.go index 0f03f5357..a1caf3b60 100644 --- a/kernel/sql/stat.go +++ b/kernel/sql/stat.go @@ -63,10 +63,3 @@ func putStat(tx *sql.Tx, key, value string) (err error) { err = execStmtTx(tx, stmt) return } - -func getStat(key string) (ret string) { - stmt := "SELECT value FROM stat WHERE `key` = '" + key + "'" - row := queryRow(stmt) - row.Scan(&ret) - return -}