diff --git a/app/changelogs/v3.6.5/v3.6.5.md b/app/changelogs/v3.6.5/v3.6.5.md index 77f4a2ad3..f01d87cf5 100644 --- a/app/changelogs/v3.6.5/v3.6.5.md +++ b/app/changelogs/v3.6.5/v3.6.5.md @@ -18,6 +18,7 @@ Below are the detailed changes in this version. * [Improve cursor positioning after Undo in tables](https://github.com/siyuan-note/siyuan/issues/17532) * [Optimize code block line number rendering for better performance](https://github.com/siyuan-note/siyuan/issues/17542) * [Improve data indexing](https://github.com/siyuan-note/siyuan/issues/17543) +* [Improve the clipping extension to resolve issues where images were too large to be clipped](https://github.com/siyuan-note/siyuan/issues/17547) ### Bugfix diff --git a/app/changelogs/v3.6.5/v3.6.5_zh_CHT.md b/app/changelogs/v3.6.5/v3.6.5_zh_CHT.md index 0329479e7..b7a3f6ddf 100644 --- a/app/changelogs/v3.6.5/v3.6.5_zh_CHT.md +++ b/app/changelogs/v3.6.5/v3.6.5_zh_CHT.md @@ -18,6 +18,7 @@ * [改進表格中撤銷後的遊標定位](https://github.com/siyuan-note/siyuan/issues/17532) * [最佳化程式碼區塊行號渲染以提升效能](https://github.com/siyuan-note/siyuan/issues/17542) * [改進資料索引](https://github.com/siyuan-note/siyuan/issues/17543) +* [改進剪藏擴充解決圖片過大無法剪藏](https://github.com/siyuan-note/siyuan/issues/17547) ### 修復缺陷 diff --git a/app/changelogs/v3.6.5/v3.6.5_zh_CN.md b/app/changelogs/v3.6.5/v3.6.5_zh_CN.md index a7a11753a..51ff14832 100644 --- a/app/changelogs/v3.6.5/v3.6.5_zh_CN.md +++ b/app/changelogs/v3.6.5/v3.6.5_zh_CN.md @@ -18,6 +18,7 @@ * [改进表格中撤销后的光标定位](https://github.com/siyuan-note/siyuan/issues/17532) * [优化代码块行号渲染以提升性能](https://github.com/siyuan-note/siyuan/issues/17542) * [改进数据索引](https://github.com/siyuan-note/siyuan/issues/17543) +* [改进剪藏扩展解决图片过大无法剪藏](https://github.com/siyuan-note/siyuan/issues/17547) ### 修复缺陷 diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts index c46720edb..c0d5088ef 100644 --- a/app/src/layout/dock/Files.ts +++ b/app/src/layout/dock/Files.ts @@ -1357,7 +1357,7 @@ class="b3-list-item b3-list-item--hide-action" data-path="${item.path}"> ${unicode2Emoji(item.icon || (item.subFileCount === 0 ? window.siyuan.storage[Constants.LOCAL_IMAGES].file : window.siyuan.storage[Constants.LOCAL_IMAGES].folder))} ${getPublishAccessOptionByLevel("public").iconHTML} ${getDisplayName(item.name, true, true)} +aria-label="${ariaLabel}">${getDisplayName(Lute.EscapeHTMLStr(item.name), true, true)} diff --git a/app/src/mobile/dock/MobileFiles.ts b/app/src/mobile/dock/MobileFiles.ts index 62f1bada8..807a7aaa8 100644 --- a/app/src/mobile/dock/MobileFiles.ts +++ b/app/src/mobile/dock/MobileFiles.ts @@ -802,7 +802,7 @@ class="b3-list-item" data-path="${item.path}"> ${unicode2Emoji(item.icon || (item.subFileCount === 0 ? window.siyuan.storage[Constants.LOCAL_IMAGES].file : window.siyuan.storage[Constants.LOCAL_IMAGES].folder))} ${getPublishAccessOptionByLevel("public").iconHTML} - ${getDisplayName(item.name, true, true)} + ${getDisplayName(Lute.EscapeHTMLStr(item.name), true, true)} diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.ts index 0c4ba697a..8a33c5482 100644 --- a/app/src/util/pathName.ts +++ b/app/src/util/pathName.ts @@ -648,7 +648,7 @@ const getLeaf = (liElement: HTMLElement, flashcard: boolean) => { ${unicode2Emoji(item.icon || (item.subFileCount === 0 ? window.siyuan.storage[Constants.LOCAL_IMAGES].file : window.siyuan.storage[Constants.LOCAL_IMAGES].folder), "b3-list-item__graphic", true)} - " + window.siyuan.languages.bookmark + " " + item.bookmark : ""}${item.name1 ? "
" + window.siyuan.languages.name + " " + item.name1 : ""}${item.alias ? "
" + window.siyuan.languages.alias + " " + item.alias : ""}${item.memo ? "
" + window.siyuan.languages.memo + " " + item.memo : ""}${item.subFileCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", item.subFileCount) : ""}
${window.siyuan.languages.modifiedAt} ${item.hMtime}
${window.siyuan.languages.createdAt} ${item.hCtime}">${getDisplayName(item.name, true, true)}
+ " + window.siyuan.languages.bookmark + " " + item.bookmark : ""}${item.name1 ? "
" + window.siyuan.languages.name + " " + item.name1 : ""}${item.alias ? "
" + window.siyuan.languages.alias + " " + item.alias : ""}${item.memo ? "
" + window.siyuan.languages.memo + " " + item.memo : ""}${item.subFileCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", item.subFileCount) : ""}
${window.siyuan.languages.modifiedAt} ${item.hMtime}
${window.siyuan.languages.createdAt} ${item.hCtime}">${getDisplayName(item.name, true, true)}
${countHTML} `; }); diff --git a/kernel/cache/ial.go b/kernel/cache/ial.go index 6dd8ee5f0..e3403dee5 100644 --- a/kernel/cache/ial.go +++ b/kernel/cache/ial.go @@ -17,9 +17,8 @@ package cache import ( - "strings" + "maps" - "github.com/88250/lute/editor" "github.com/dgraph-io/ristretto" ) @@ -40,9 +39,7 @@ func GetDocIAL(p string) (ret map[string]string) { } ret = map[string]string{} - for k, v := range ial.(map[string]string) { - ret[k] = strings.ReplaceAll(v, editor.IALValEscNewLine, "\n") - } + maps.Copy(ret, ial.(map[string]string)) return } diff --git a/kernel/filesys/tree.go b/kernel/filesys/tree.go index 4c93f203f..680a1667c 100644 --- a/kernel/filesys/tree.go +++ b/kernel/filesys/tree.go @@ -199,7 +199,7 @@ func LoadTreeByData(data []byte, boxID, p string, luteEngine *lute.Lute) (ret *p if "" == title { title = "Untitled" } - hPathBuilder.WriteString(util.UnescapeHTML(title)) + hPathBuilder.WriteString(title) hPathBuilder.WriteString("/") } hPathBuilder.WriteString(ret.Root.IALAttr("title")) @@ -228,6 +228,10 @@ func DocIAL(absPath string) (ret map[string]string) { } file.Close() filelock.Unlock(absPath) + + for k, v := range ret { + ret[k] = html.UnescapeAttrVal(v) + } return } @@ -386,7 +390,7 @@ func removeUnescapedUnicodeNull(data []byte) []byte { } func afterWriteTree(tree *parse.Tree) { - docIAL := parse.IAL2MapUnEsc(tree.Root.KramdownIAL) + docIAL := parse.IAL2Map(tree.Root.KramdownIAL) cache.PutDocIAL(tree.Path, docIAL) } diff --git a/kernel/model/file.go b/kernel/model/file.go index 313ffe01d..f7ae55a60 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -80,7 +80,7 @@ func (box *Box) docFromFileInfo(fileInfo *FileInfo, ial map[string]string) (ret ret = &File{} ret.Path = fileInfo.path ret.Size = uint64(fileInfo.size) - ret.Name = ial["title"] + ".sy" + ret.Name = ial["title"] ret.Icon = ial["icon"] ret.ID = ial["id"] ret.Name1 = ial["name"] diff --git a/kernel/model/index.go b/kernel/model/index.go index 1384d3633..e8af7ac42 100644 --- a/kernel/model/index.go +++ b/kernel/model/index.go @@ -170,7 +170,7 @@ func indexBox(boxID string) { return } - docIAL := parse.IAL2MapUnEsc(tree.Root.KramdownIAL) + docIAL := parse.IAL2Map(tree.Root.KramdownIAL) if "" == docIAL["updated"] { // 早期的数据可能没有 updated 属性,这里进行订正 updated := util.TimeFromID(tree.Root.ID) tree.Root.SetIALAttr("updated", updated)