From ccbce617555b55a268e916b46c12bbc59c16d73b Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Mon, 25 May 2026 11:31:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(parser):=20=E7=BB=99decodeEntity=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0amp=E9=BB=98=E8=AE=A4=E5=8F=82=E6=95=B0=E4=B8=BAtrue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补充默认参数值,避免调用时未传参导致的逻辑异常 --- uni_modules/mp-html/components/mp-html/parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uni_modules/mp-html/components/mp-html/parser.js b/uni_modules/mp-html/components/mp-html/parser.js index 574f6b7..c0c9fa2 100644 --- a/uni_modules/mp-html/components/mp-html/parser.js +++ b/uni_modules/mp-html/components/mp-html/parser.js @@ -122,7 +122,7 @@ function makeMap (str) { * @param {Boolean} amp 要不要解码 & * @returns {String} 解码后的字符串 */ -function decodeEntity (str, amp) { +function decodeEntity (str, amp = true) { let i = str.indexOf('&') while (i !== -1) { const j = str.indexOf(';', i + 3)