diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 41b909d35..e7997fb73 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -33,4 +33,4 @@ jobs: - name: Build the Docker image run: | - docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t b3log/siyuan:latest -t b3log/siyuan:v2.9.9 . \ No newline at end of file + docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 -t b3log/siyuan:latest -t b3log/siyuan:v2.10.0 . \ No newline at end of file diff --git a/app/appx/AppxManifest.xml b/app/appx/AppxManifest.xml index 1e1775fef..57796a49a 100644 --- a/app/appx/AppxManifest.xml +++ b/app/appx/AppxManifest.xml @@ -9,7 +9,7 @@ + Version="2.10.0.0"/> SiYuan 云南链滴科技有限公司 diff --git a/app/changelogs/v2.10.0/v2.10.0.md b/app/changelogs/v2.10.0/v2.10.0.md index ed06022d1..d27fb6369 100644 --- a/app/changelogs/v2.10.0/v2.10.0.md +++ b/app/changelogs/v2.10.0/v2.10.0.md @@ -33,6 +33,8 @@ Below are the detailed changes in this version. * [Enable HTML-related features in KaTeX](https://github.com/siyuan-note/siyuan/pull/8951) * [Heading convert to doc does not use naming as doc name](https://github.com/siyuan-note/siyuan/issues/8959) * [Turn off math warnings in Chinese](https://github.com/siyuan-note/siyuan/pull/8963) +* [Set the maximum height of the tooltip](https://github.com/siyuan-note/siyuan/issues/8978) +* [Add the configuration of show/hide dock shortcut keys](https://github.com/siyuan-note/siyuan/issues/8979) ### Bugfix diff --git a/app/changelogs/v2.10.0/v2.10.0_zh_CHT.md b/app/changelogs/v2.10.0/v2.10.0_zh_CHT.md index ad3dddea2..90fbd075a 100644 --- a/app/changelogs/v2.10.0/v2.10.0_zh_CHT.md +++ b/app/changelogs/v2.10.0/v2.10.0_zh_CHT.md @@ -33,7 +33,8 @@ * [啟用 KaTex 的 HTML 相關特性](https://github.com/siyuan-note/siyuan/pull/8951) * [標題轉換文檔不再使用命名作為文檔名](https://github.com/siyuan-note/siyuan/issues/8959) * [關閉公式中文警告](https://github.com/siyuan-note/siyuan/pull/8963) - +* [設置提示最大寬度](https://github.com/siyuan-note/siyuan/issues/8978) +* [添加顯示和隱藏停靠欄快捷鍵配置](https://github.com/siyuan-note/siyuan/issues/8979) ### 修復缺陷 diff --git a/app/changelogs/v2.10.0/v2.10.0_zh_CN.md b/app/changelogs/v2.10.0/v2.10.0_zh_CN.md index 5e1b56970..006911116 100644 --- a/app/changelogs/v2.10.0/v2.10.0_zh_CN.md +++ b/app/changelogs/v2.10.0/v2.10.0_zh_CN.md @@ -33,7 +33,8 @@ * [启用 KaTex 的 HTML 相关特性](https://github.com/siyuan-note/siyuan/pull/8951) * [标题转换文档不再使用命名作为文档名](https://github.com/siyuan-note/siyuan/issues/8959) * [关闭公式中文警告](https://github.com/siyuan-note/siyuan/pull/8963) - +* [设置提示最大宽度](https://github.com/siyuan-note/siyuan/issues/8978) +* [添加显示和隐藏停靠栏快捷键配置](https://github.com/siyuan-note/siyuan/issues/8979) ### 修复缺陷 diff --git a/app/package.json b/app/package.json index 900c0296d..903168e22 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "SiYuan", - "version": "2.9.9", + "version": "2.10.0", "description": "Refactor your thinking", "homepage": "https://b3log.org/siyuan", "main": "./electron/main.js", diff --git a/kernel/model/asset_content.go b/kernel/model/asset_content.go index 0ce0d31a1..be4559edb 100644 --- a/kernel/model/asset_content.go +++ b/kernel/model/asset_content.go @@ -32,6 +32,7 @@ import ( "github.com/siyuan-note/eventbus" "github.com/siyuan-note/filelock" "github.com/siyuan-note/logging" + "github.com/siyuan-note/siyuan/kernel/search" "github.com/siyuan-note/siyuan/kernel/sql" "github.com/siyuan-note/siyuan/kernel/task" "github.com/siyuan-note/siyuan/kernel/util" @@ -63,7 +64,7 @@ func GetAssetContent(id, query string, queryMethod int) (ret *AssetContent) { } projections := "id, name, ext, path, size, updated, " + - "highlight(" + table + ", 6, '', '') AS content" + "highlight(" + table + ", 6, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "') AS content" stmt := "SELECT " + projections + " FROM " + table + " WHERE " + filter assetContents := sql.SelectAssetContentsRawStmt(stmt, 1, 1) results := fromSQLAssetContents(&assetContents, 36) @@ -155,7 +156,7 @@ func fullTextSearchAssetContentCountByRegexp(exp, typeFilter string) (matchedAss func fullTextSearchAssetContentByFTS(query, typeFilter, orderBy string, beforeLen, page, pageSize int) (ret []*AssetContent, matchedAssetCount int) { table := "asset_contents_fts_case_insensitive" projections := "id, name, ext, path, size, updated, " + - "snippet(" + table + ", 6, '', '', '...', 64) AS content" + "snippet(" + table + ", 6, '" + search.SearchMarkLeft + "', '" + search.SearchMarkRight + "', '...', 64) AS content" stmt := "SELECT " + projections + " FROM " + table + " WHERE (`" + table + "` MATCH '" + buildAssetContentColumnFilter() + ":(" + query + ")'" stmt += ") AND ext IN " + typeFilter stmt += " " + orderBy @@ -215,6 +216,12 @@ func fromSQLAssetContents(assetContents *[]*sql.AssetContent, beforeLen int) (re } func fromSQLAssetContent(assetContent *sql.AssetContent, beforeLen int) *AssetContent { + content := util.EscapeHTML(assetContent.Content) + if strings.Contains(content, search.SearchMarkLeft) { + content = strings.ReplaceAll(content, search.SearchMarkLeft, "") + content = strings.ReplaceAll(content, search.SearchMarkRight, "") + } + return &AssetContent{ ID: assetContent.ID, Name: assetContent.Name, @@ -223,7 +230,7 @@ func fromSQLAssetContent(assetContent *sql.AssetContent, beforeLen int) *AssetCo Size: assetContent.Size, HSize: humanize.Bytes(uint64(assetContent.Size)), Updated: assetContent.Updated, - Content: assetContent.Content, + Content: content, } } @@ -275,6 +282,8 @@ func buildAssetContentOrderBy(orderBy int) string { var assetContentSearcher = NewAssetsSearcher() func IndexAssetContent(absPath string) { + defer logging.Recover() + assetsDir := util.GetDataAssetsAbsPath() ext := strings.ToLower(filepath.Ext(absPath)) @@ -346,6 +355,8 @@ type AssetsSearcher struct { } func (searcher *AssetsSearcher) FullIndex() { + defer logging.Recover() + assetsDir := util.GetDataAssetsAbsPath() if !gulu.File.IsDir(assetsDir) { return @@ -455,6 +466,11 @@ func copyTempAsset(absPath string) (ret string) { return } + baseName := filepath.Base(absPath) + if strings.HasPrefix(baseName, "~") { + return + } + filelock.RWLock.Lock() defer filelock.RWLock.Unlock() diff --git a/kernel/util/working.go b/kernel/util/working.go index d3ff437d4..3bf44413b 100644 --- a/kernel/util/working.go +++ b/kernel/util/working.go @@ -42,7 +42,7 @@ import ( var Mode = "prod" const ( - Ver = "2.9.9" + Ver = "2.10.0" IsInsider = false )