Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
c75a4119e3
8 changed files with 29 additions and 9 deletions
2
.github/workflows/dockerimage.yml
vendored
2
.github/workflows/dockerimage.yml
vendored
|
@ -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 .
|
||||
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 .
|
|
@ -9,7 +9,7 @@
|
|||
<Identity Name="89C2A984.SiYuan"
|
||||
ProcessorArchitecture="x64"
|
||||
Publisher='CN=087C656E-C1D9-42D8-8807-CED45A74FC0F'
|
||||
Version="2.9.9.0"/>
|
||||
Version="2.10.0.0"/>
|
||||
<Properties>
|
||||
<DisplayName>SiYuan</DisplayName>
|
||||
<PublisherDisplayName>云南链滴科技有限公司</PublisherDisplayName>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
### 修復缺陷
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
### 修复缺陷
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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, '<mark>', '</mark>') 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, '<mark>', '</mark>', '...', 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, "<mark>")
|
||||
content = strings.ReplaceAll(content, search.SearchMarkRight, "</mark>")
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ import (
|
|||
var Mode = "prod"
|
||||
|
||||
const (
|
||||
Ver = "2.9.9"
|
||||
Ver = "2.10.0"
|
||||
IsInsider = false
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue