1 Star 0 Fork 1

兴趣工作室/Message-Push-ScriptCat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test.html 950 Bytes
一键复制 编辑 原始数据 按行查看 历史
白羽 提交于 2023-06-18 09:14 . 修改名字和版本号
<!--
* @Author: 白羽
* @Date: 2023-06-05 18:49:02
* @LastEditors: 白羽 [email protected]
* @LastEditTime: 2023-06-17 13:00:17
* @FilePath: \scriptcat-push-weixin\test.html
* @Description:
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p>
Lorem, ipsum.
<!-- <b>Lorem, ipsum.</b> -->
</p>
<script>
const tamplate = `
{{DATA.num}}
`.trim();
function replaceTemplate(DATA = {}, str = "") {
const regex = /\{\{(DATA\.[_|a-z|A-Z\d|\w|\.]*)\}\}/gm;
let matches = [...str.matchAll(regex)];
matches.forEach(match => {
str = str.replace(match[0], eval(match[1]));
});
return str;
}
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qeruiop/Message-Push-ScriptCat.git
[email protected]:qeruiop/Message-Push-ScriptCat.git
qeruiop
Message-Push-ScriptCat
Message-Push-ScriptCat
master

搜索帮助