字符串映射功能bug:导致输入的网址部分失效

Innis 2020-8-8 749

字符串映射功能:输入`_2`,转换成下标`₂`,如:`H_2` 转换成 `H₂` 

输入:https://www.sohu.com/a/307789588_652984

映射为:https://www.sohu.com/a/307789588₆₅₂₉₈₄

导致输入的网址无法访问


快速回复
最新回复 (1)
  • Innis 2020-8-22
    0 2
    删除字符串映射中的:
        '/_([0-9]+)\s/': ({match}) => {
            const str = '₀₁₂₃₄₅₆₇₈₉', arr = match[1].split('');
            let result = '';
            for (let i=0; i<=arr.length-1; i++) {
                result += str[arr[i]];
            }
            return result;
        }
    即可
返回