ECharts 图表块支持 loose-json (#6917)

* 🎨 ECharts 图表块支持 loose-json

* 📝 更新用户手册 ECharts 相关内容

* 📝 更新用户手册 ECharts 相关内容
This commit is contained in:
颖逸 2022-12-25 10:27:02 +08:00 committed by GitHub
parent a96d6a019f
commit 27c9ac2b25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 799 additions and 28 deletions

View file

@ -45,3 +45,8 @@ export const isDynamicRef = (text: string) => {
export const isFileAnnotation = (text: string) => {
return /^<<assets\/.+\/\d{14}-\w{7} ".+">>$/.test(text);
};
// 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})`)();
}