2.3.3: 分类下条目数量标注;#标签、嵌套标签支持正则表达式 #191
-
如果你不会正则表达式,但有高级需求,请在讨论中提问 static getTagMatch(tag: string) {
// 监测是否为正则表达式
const rawString = Zotero.Prefs.get(`${config.addonRef}.textTagsColumn.match`) as string
const res = rawString.match(/\/(.+)\/(\w*)/)
let regex: RegExp;
// 是正则表达式
if (res) {
regex = new RegExp(res[1], res[2])
}
// 不以xxx开头
else if (rawString.startsWith("~~")) {
regex = new RegExp(`^([^${rawString.slice(2)}].+)`)
}
// 以xxx开头
else {
regex = new RegExp(`^${rawString}(.+)`)
}
const matched = tag.match(regex)
return (matched && matched.slice(1).join("")) || ""
}This discussion was created from the release 2.3.3: 分类下条目数量标注;#标签、嵌套标签支持正则表达式. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 32 replies
-
Beta Was this translation helpful? Give feedback.
-
|
请问如何关闭分类下条目数量标注的功能,看得我有点难受 |
Beta Was this translation helpful? Give feedback.
-
|
为什么这么设置了,SCIIF(5)这个地方还是不显示IF(5)? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
|
嵌套标签是例如:#材料/无机/Ni基。想在#标签一栏中,分别显示材料、无机、Ni基三个,而不是显示成材料/无机/Ni基,应该怎么做? |
Beta Was this translation helpful? Give feedback.
-
|
这个功能真的超级赞!但是嵌套标签不能支持群组文库,无法推广到团队里使用QAQ,希望能添加群组支持 |
Beta Was this translation helpful? Give feedback.
-
|
发现在最新版本(7.0.27 (64-bit),插件版本5.7.6.6)中如果正则表达式写成
左下角的嵌套标签会显示空白,同时#标签正常 我这么写是由于#开头的标签如果被同时设置为颜色标签,无法在“标签”列显示(也就是不显示彩色圆点),于是尝试定义字符串内部所有包含 如果设置为
左下角显示正常,但是#标签一列显示会缺少第一个字符 |
Beta Was this translation helpful? Give feedback.






请问如何关闭分类下条目数量标注的功能,看得我有点难受