From 2167dfb24131e837292c4577cceeb05ddb4533b5 Mon Sep 17 00:00:00 2001 From: wooseok Date: Sat, 18 May 2024 19:29:42 +0900 Subject: [PATCH] fix : remove deprecated 'navigator.platform' and prevent potential error in ssr environment --- apps/editor/src/utils/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/editor/src/utils/common.ts b/apps/editor/src/utils/common.ts index 642b012c19..e10d618afa 100644 --- a/apps/editor/src/utils/common.ts +++ b/apps/editor/src/utils/common.ts @@ -5,7 +5,7 @@ import forEachOwnProperties from 'tui-code-snippet/collection/forEachOwnProperti import { LinkAttributeNames, LinkAttributes } from '@t/editor'; -export const isMac = /Mac/.test(navigator.platform); +export const isMac = navigator !== undefined && navigator.userAgent.indexOf("Mac") > -1; const reSpaceMoreThanOne = /[\u0020]+/g; const reEscapeChars = /[>(){}[\]+-.!#|]/g; const reEscapeHTML = /<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>||<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g;