From 35f420a08e88702ef22da2bd3812dc65d02a8227 Mon Sep 17 00:00:00 2001 From: Tron Date: Mon, 2 Dec 2024 16:23:41 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20v1.2.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ plugin.json | 2 +- src/index.ts | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b641d7..c77f71d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.2.3 / 2024.12.02 + +- 🐛 fix 命令【取消脚注编号】对index内容的重命名错误 + ## v1.2.2 / 2024.12.02 - ✨ 脚注容器标题可以支持设置为段落块,不需要一定是标题了! diff --git a/plugin.json b/plugin.json index 047f714..a51198a 100644 --- a/plugin.json +++ b/plugin.json @@ -2,7 +2,7 @@ "name": "siyuan-plugin-blockref-footnote", "author": "Achuan-2", "url": "https://github.com/Achuan-2/siyuan-plugin-blockref-footnote", - "version": "1.2.2", + "version": "1.2.3", "minAppVersion": "3.1.13", "backends": [ "windows", diff --git a/src/index.ts b/src/index.ts index ab5f887..00732f0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -412,8 +412,8 @@ export default class PluginFootnote extends Plugin { }, editorCallback: async (protyle: any) => { if (protyle.block?.rootID) { - await this.reorderFootnotes(protyle.block.rootID, true); await pushMsg(this.i18n.cancelReorderFootnotes + " ..."); + await this.reorderFootnotes(protyle.block.rootID, true); await pushMsg(this.i18n.cancelReorderFootnotes + " Finished"); } }, @@ -1316,12 +1316,13 @@ export default class PluginFootnote extends Plugin { Array.from(footnoteIds).map(async footnoteId => { let footnoteBlock = (await getBlockDOM(footnoteId)).dom; if (footnoteBlock) { - footnoteBlock = footnoteBlock.replace(/(]*>)[^<]*(<\/span>)/g, "$1" + this.i18n.indexAnchor + "$2"); + updateBlock("dom", footnoteBlock, footnoteId); } - updateBlock("dom", footnoteBlock, footnoteId); // return setBlockAttrs(footnoteId, { "name": "" }); }) ); + } }