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
61 lines (55 loc) · 1.09 KB
/
config.js
File metadata and controls
61 lines (55 loc) · 1.09 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
import { ENCODING_NAME_MAP } from 'common/encoding'
export const tabSizeOptions = [{
label: '1',
value: 1
}, {
label: '2',
value: 2
}, {
label: '3',
value: 3
}, {
label: '4',
value: 4
}]
export const endOfLineOptions = [{
label: 'Default',
value: 'default'
}, {
label: 'Carriage return and line feed (CRLF)',
value: 'crlf'
}, {
label: 'Line feed (LF)',
value: 'lf'
}]
export const trimTrailingNewlineOptions = [{
label: 'Trim all trailing',
value: 0
}, {
label: 'Ensure exactly one trailing',
value: 1
}, {
label: 'Preserve style of original document',
value: 2
}, {
label: 'Do nothing',
value: 3
}]
export const textDirectionOptions = [{
label: 'Left to Right',
value: 'ltr'
}, {
label: 'Right to Left',
value: 'rtl'
}]
let defaultEncodingOptions = null
export const getDefaultEncodingOptions = () => {
if (defaultEncodingOptions) {
return defaultEncodingOptions
}
defaultEncodingOptions = []
for (const [value, label] of Object.entries(ENCODING_NAME_MAP)) {
defaultEncodingOptions.push({ label, value })
}
return defaultEncodingOptions
}