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;