fix(parser): 给decodeEntity添加amp默认参数为true
补充默认参数值,避免调用时未传参导致的逻辑异常
This commit is contained in:
@@ -122,7 +122,7 @@ function makeMap (str) {
|
|||||||
* @param {Boolean} amp 要不要解码 &
|
* @param {Boolean} amp 要不要解码 &
|
||||||
* @returns {String} 解码后的字符串
|
* @returns {String} 解码后的字符串
|
||||||
*/
|
*/
|
||||||
function decodeEntity (str, amp) {
|
function decodeEntity (str, amp = true) {
|
||||||
let i = str.indexOf('&')
|
let i = str.indexOf('&')
|
||||||
while (i !== -1) {
|
while (i !== -1) {
|
||||||
const j = str.indexOf(';', i + 3)
|
const j = str.indexOf(';', i + 3)
|
||||||
|
|||||||
Reference in New Issue
Block a user