diff --git a/_site/heti-addon.js b/_site/heti-addon.js index 6aad703..1ab17f4 100644 --- a/_site/heti-addon.js +++ b/_site/heti-addon.js @@ -688,6 +688,13 @@ class Heti { constructor (rootSelector) { + try { + new RegExp(`(?<=\d)\d`, 'g').test(''); + } catch (err) { + console.warn(err.name, '浏览器尚未实现 RegExp positive lookbehind'); + return + } + this.rootSelector = rootSelector || '.heti'; this.REG_FULL = new RegExp(`(?<=[${CJK}])( *[${ANS}]+(?: +[${ANS}]+)* *)(?=[${CJK}])`, 'g'); this.REG_START = new RegExp(`([${ANS}]+(?: +[${ANS}]+)* *)(?=[${CJK}])`, 'g'); diff --git a/js/heti-addon.js b/js/heti-addon.js index 5a00551..f8d1113 100644 --- a/js/heti-addon.js +++ b/js/heti-addon.js @@ -44,6 +44,13 @@ const hasOwn = {}.hasOwnProperty class Heti { constructor (rootSelector) { + try { + new RegExp(`(?<=\d)\d`, 'g').test('') + } catch (err) { + console.warn(err.name, '浏览器尚未实现 RegExp positive lookbehind') + return + } + this.rootSelector = rootSelector || '.heti' this.REG_FULL = new RegExp(`(?<=[${CJK}])( *[${ANS}]+(?: +[${ANS}]+)* *)(?=[${CJK}])`, 'g') this.REG_START = new RegExp(`([${ANS}]+(?: +[${ANS}]+)* *)(?=[${CJK}])`, 'g')