2.3.3: 分类下条目数量标注;#标签、嵌套标签支持正则表达式 #191
Answered
by
ghost
MuiseDestiny
asked this question in
Q&A
-
如果你不会正则表达式,但有高级需求,请在讨论中提问 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.
Answered by
ghost
Mar 4, 2023
Replies: 7 comments 30 replies
-
请问如何关闭分类下条目数量标注的功能,看得我有点难受 |
Beta Was this translation helpful? Give feedback.
12 replies
Answer selected by
MuiseDestiny
-
为什么这么设置了,SCIIF(5)这个地方还是不显示IF(5)? |
Beta Was this translation helpful? Give feedback.
0 replies
This comment has been hidden.
This comment has been hidden.
-
嵌套标签是例如:#材料/无机/Ni基。想在#标签一栏中,分别显示材料、无机、Ni基三个,而不是显示成材料/无机/Ni基,应该怎么做? |
Beta Was this translation helpful? Give feedback.
0 replies
-
这个功能真的超级赞!但是嵌套标签不能支持群组文库,无法推广到团队里使用QAQ,希望能添加群组支持 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
请问如何关闭分类下条目数量标注的功能,看得我有点难受