Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom IAL attr name support more symbol #8172

Merged
merged 4 commits into from May 6, 2023

Conversation

Zuoqiu-Yingyi
Copy link
Contributor

@Zuoqiu-Yingyi Zuoqiu-Yingyi commented May 4, 2023

  • Please commit to the dev branch

自定义 IAL 的属性名称支持更多符号
Custom IAL attribute names support more symbol

  • _
  • .

已通过测试 | Tested passed

REF:

疑问: 之前自定义属性名称不支持 [\-0-9a-zA-Z] 以外的字符是出于什么考虑❓

附:

若想要支持所有合法的自定义 XML 属性值, 可以使用如下正则表达式

/^custom-([:_.\-0-9a-zA-Z\u{B7}\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{300}-\u{36F}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{203F}-\u{2040}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}])+$/u

若想要支持所有合法的 XML 属性值, 可以使用如下正则表达式

/^([:_A-Za-z\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}])([:_.\-A-Za-z0-9\u{B7}\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{300}-\u{36F}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{203F}-\u{2040}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}])*$/u

@88250 88250 requested a review from Vanessa219 May 5, 2023 00:52
@88250 88250 changed the title Custom ial key support more symbol Custom ial name support more symbol May 6, 2023
@88250 88250 changed the title Custom ial name support more symbol Custom IAL attr name support more symbol May 6, 2023
@88250
Copy link
Member

88250 commented May 6, 2023

之前担心会有其他问题,所以把范围设置窄一些。

@88250 88250 added this to the 2.8.7 milestone May 6, 2023
@88250 88250 merged commit 825822e into siyuan-note:dev May 6, 2023
3 checks passed
@Zuoqiu-Yingyi Zuoqiu-Yingyi deleted the enhance/custom-ial-key branch May 6, 2023 07:35
@Zuoqiu-Yingyi
Copy link
Contributor Author

之前担心会有其他问题,所以把范围设置窄一些。

测试时发现导出的模板 IAL 的 key 中存在中文时确实在导入时无效

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants