Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-05-06 15:44:39 +08:00
commit db6521181e
5 changed files with 9 additions and 5 deletions

View file

@ -310,7 +310,7 @@ export const openFileAttr = (attrs: IObject, id: string, focusName = "bookmark")
name = "custom-" + (item.parentElement.querySelector(".b3-text-field") as HTMLInputElement).value;
}
if (item.value.trim()) {
if (!/^[0-9a-zA-Z\-]*$/.test(name.replace("custom-", "")) || name === "custom-") {
if (!/^custom-[_.\-0-9a-zA-Z]+$/.test(name)) {
errorTip += name.replace("custom-", "") + ", ";
return;
}
@ -381,7 +381,7 @@ export const openAttr = (nodeElement: Element, protyle: IProtyle, focusName = "b
name = "custom-" + (item.parentElement.querySelector(".b3-text-field") as HTMLInputElement).value;
}
if (item.value.trim()) {
if (!/^[0-9a-zA-Z\-]*$/.test(name.replace("custom-", "")) || name === "custom-") {
if (!/^custom-[_.\-0-9a-zA-Z]+$/.test(name)) {
errorTip += name.replace("custom-", "") + ", ";
return;
}