fix(parser): 给decodeEntity添加amp默认参数为true

补充默认参数值,避免调用时未传参导致的逻辑异常
This commit is contained in:
2026-05-25 11:31:30 +08:00
parent b827aba722
commit ccbce61755

View File

@@ -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)