From 606f8d5f038eab14b8741f65a2b3cb2ac8a5cfed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=9A=E9=A3=8E=E6=8B=82=E6=9F=B3=E9=A2=9C?= <434857005@qq.com> Date: Sat, 4 May 2024 02:17:14 +0800 Subject: [PATCH] add $js for t3 --- src/renderer/src/utils/drpy/drpy3.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/utils/drpy/drpy3.ts b/src/renderer/src/utils/drpy/drpy3.ts index 19eec28f2..864aa0e6d 100644 --- a/src/renderer/src/utils/drpy/drpy3.ts +++ b/src/renderer/src/utils/drpy/drpy3.ts @@ -92,7 +92,7 @@ const pre = () => { let rule = {}; // @ts-ignore let vercode = typeof pdfl === 'function' ? 'drpy3.1' : 'drpy3'; -const VERSION = `${vercode} 3.9.50beta5 202400502`; +const VERSION = `${vercode} 3.9.50beta6 202400504`; /** 已知问题记录 * 1.影魔的jinjia2引擎不支持 {{fl}}对象直接渲染 (有能力解决的话尽量解决下,支持对象直接渲染字符串转义,如果加了|safe就不转义)[影魔牛逼,最新的文件发现这问题已经解决了] * Array.prototype.append = Array.prototype.push; 这种js执行后有毛病,for in 循环列表会把属性给打印出来 (这个大毛病需要重点排除一下) @@ -150,6 +150,14 @@ const URLJOIN_ATTR = /(url|src|href|-original|-src|-play|-url|style)$/; // 需 const SELECT_REGEX = /:eq|:lt|:gt|#/g; const SELECT_REGEX_A = /:eq|:lt|:gt/g; +// 增加$js工具,支持$js.toString(()=>{}); +const $js = { + toString(func) { + let strfun = func.toString(); + return strfun.replace(/^\(\)(\s+)?=>(\s+)?\{/, "js:").replace(/\}$/,''); + } +}; + function window_b64() { let b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; let base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1); @@ -2847,6 +2855,7 @@ const keepUnUse = { fixAdM3u8, fixAdM3u8Ai, // ad base64Encode, md5, decodeStr, RSA, // encryption and decryption clearItem, // cache + $js, // $工具 }; let temp = _; temp.stringify({});