Skip to content

Commit

Permalink
🔖v1.0.2 / 2024.11.19
Browse files Browse the repository at this point in the history
- ✨对选中文本(变量:selection)进行过滤,不包含脚注锚文本,这样方便对重叠的内容进行脚注
  • Loading branch information
Achuan-2 committed Nov 19, 2024
1 parent d2ead74 commit 1d52954
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ TODO
- [ ] 参考<https://github.com/zxhd863943427/siyuan-plugin-memo>,添加css样式


## v1.0.2 / 2024.11.19

- ✨对选中文本(变量:selection)进行过滤,不包含脚注锚文本,这样方便对重叠的内容进行脚注

## v1.0.1 / 2024.11.19

- 📝更新README
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "siyuan-plugin-blockref-footnote",
"author": "Achuan-2",
"url": "https://github.com/Achuan-2/siyuan-plugin-blockref-footnote",
"version": "1.0.1",
"version": "1.0.2",
"minAppVersion": "3.1.12",
"backends": [
"windows",
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,14 @@ export default class PluginMemo extends Plugin {
}


// 获取脚注模板并替换为具体变量值
// 获取脚注模板并替换为具体变量值
const selection = await navigator.clipboard.readText(); // 获取选中文本
// 过滤掉脚注文本 <sup>((id "text"))</sup>
const cleanSelection = selection.replace(/<sup>\(\([^)]+\)\)<\/sup>/g, '');
console.log(cleanSelection);
let templates = this.settingUtils.get("templates");
templates = templates.replace(/\$\{selection\}/g, selection);
templates = templates.replace(/\$\{selection\}/g, cleanSelection);
templates = templates.replace(/\$\{content\}/g, zeroWhite);

// 插入脚注
Expand Down

0 comments on commit 1d52954

Please sign in to comment.