forked from marktext/marktext
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
80 lines (73 loc) · 1.89 KB
/
config.js
File metadata and controls
80 lines (73 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
export const isOsx = process.platform === 'darwin'
export const isWindows = process.platform === 'win32'
export const isLinux = process.platform === 'linux'
export const editorWinOptions = Object.freeze({
minWidth: 550,
minHeight: 350,
webPreferences: {
contextIsolation: false,
// WORKAROUND: We cannot enable spellcheck if it was disabled during
// renderer startup due to a bug in Electron (Electron#32755). We'll
// enable it always and set the HTML spelling attribute to false.
spellcheck: true,
nodeIntegration: true,
webSecurity: false
},
useContentSize: true,
show: true,
frame: false,
titleBarStyle: 'hiddenInset',
zoomFactor: 1.0
})
export const preferencesWinOptions = Object.freeze({
minWidth: 450,
minHeight: 350,
width: 950,
height: 650,
webPreferences: {
contextIsolation: false,
// Always true to access native spellchecker.
spellcheck: true,
nodeIntegration: true,
webSecurity: false
},
fullscreenable: false,
fullscreen: false,
minimizable: false,
useContentSize: true,
show: true,
frame: false,
thickFrame: !isOsx,
titleBarStyle: 'hiddenInset',
zoomFactor: 1.0
})
export const PANDOC_EXTENSIONS = Object.freeze([
'html',
'docx',
'odt',
'latex',
'tex',
'ltx',
'rst',
'rest',
'org',
'wiki',
'dokuwiki',
'textile',
'opml',
'epub'
])
export const BLACK_LIST = Object.freeze([
'$RECYCLE.BIN'
])
export const EXTENSION_HASN = Object.freeze({
styledHtml: '.html',
pdf: '.pdf'
})
export const TITLE_BAR_HEIGHT = isOsx ? 21 : 32
export const LINE_ENDING_REG = /(?:\r\n|\n)/g
export const LF_LINE_ENDING_REG = /(?:[^\r]\n)|(?:^\n$)/
export const CRLF_LINE_ENDING_REG = /\r\n/
export const GITHUB_REPO_URL = 'https://github.com/marktext/marktext'
// copy from muya
export const URL_REG = /^http(s)?:\/\/([a-z0-9\-._~]+\.[a-z]{2,}|[0-9.]+|localhost|\[[a-f0-9.:]+\])(:[0-9]{1,5})?(\/[\S]+)?/i