mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-02 10:50:15 +01:00
🐛 Fix IAL name checking functionality (#8204)
This commit is contained in:
parent
9950848a4e
commit
0d5b04e4dd
2 changed files with 9 additions and 5 deletions
|
|
@ -42,6 +42,10 @@ export const isFileAnnotation = (text: string) => {
|
|||
return /^<<assets\/.+\/\d{14}-\w{7} ".+">>$/.test(text);
|
||||
};
|
||||
|
||||
export const isValidAttrName = (name: string) => {
|
||||
return /^[_a-zA-Z][_.\-0-9a-zA-Z]*$/.test(name);
|
||||
};
|
||||
|
||||
// REF https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/eval
|
||||
export const looseJsonParse = (text: string) => {
|
||||
return Function(`"use strict";return (${text})`)();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue