1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-11 17:53:59 +02:00

bugfix: avoid lookbehind (#5503)

This commit is contained in:
Jan Paepke
2023-08-29 13:49:34 +02:00
committed by GitHub
parent f8d8d017d1
commit e308cd664d
2 changed files with 7 additions and 1 deletions

View File

@@ -55,7 +55,8 @@ export const IS_UC_MOBILE =
// Wechat browser (not including mac wechat)
export const IS_WECHATBROWSER =
typeof navigator !== 'undefined' &&
/.*(?<!Mac)Wechat/.test(navigator.userAgent)
/.*Wechat/.test(navigator.userAgent) &&
!/.*MacWechat/.test(navigator.userAgent) // avoid lookbehind (buggy in safari < 16.4)
// Check if DOM is available as React does internally.
// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js