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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
import { __ } from '~/locale';
// Language map from Rouge::Lexer to highlight.js
// Rouge::Lexer - We use it on the BE to determine the language of a source file (https://github.com/rouge-ruby/rouge/blob/master/docs/Languages.md).
// Highlight.js - We use it on the FE to highlight the syntax of a source file (https://github.com/highlightjs/highlight.js/tree/main/src/languages).
export const ROUGE_TO_HLJS_LANGUAGE_MAP = {
bsl: '1c',
actionscript: 'actionscript',
ada: 'ada',
apache: 'apache',
applescript: 'applescript',
armasm: 'armasm',
awk: 'awk',
c: 'c',
ceylon: 'ceylon',
clean: 'clean',
clojure: 'clojure',
cmake: 'cmake',
coffeescript: 'coffeescript',
coq: 'coq',
cpp: 'cpp',
crystal: 'crystal',
csharp: 'csharp',
css: 'css',
d: 'd',
dart: 'dart',
pascal: 'delphi',
diff: 'diff',
jinja: 'django',
docker: 'dockerfile',
batchfile: 'dos',
elixir: 'elixir',
elm: 'elm',
erb: 'erb',
erlang: 'erlang',
fortran: 'fortran',
fsharp: 'fsharp',
gherkin: 'gherkin',
glsl: 'glsl',
go: 'go',
gradle: 'gradle',
groovy: 'groovy',
haml: 'haml',
handlebars: 'handlebars',
haskell: 'haskell',
haxe: 'haxe',
http: 'http',
hylang: 'hy',
ini: 'ini',
isbl: 'isbl',
java: 'java',
javascript: 'javascript',
json: 'json',
julia: 'julia',
kotlin: 'kotlin',
lasso: 'lasso',
tex: 'latex',
common_lisp: 'lisp',
livescript: 'livescript',
llvm: 'llvm',
hlsl: 'lsl',
lua: 'lua',
make: 'makefile',
markdown: 'markdown',
mathematica: 'mathematica',
matlab: 'matlab',
moonscript: 'moonscript',
nginx: 'nginx',
nim: 'nim',
nix: 'nix',
objective_c: 'objectivec',
ocaml: 'ocaml',
perl: 'perl',
php: 'php',
plaintext: 'plaintext',
pony: 'pony',
powershell: 'powershell',
prolog: 'prolog',
properties: 'properties',
protobuf: 'protobuf',
puppet: 'puppet',
python: 'python',
q: 'q',
qml: 'qml',
r: 'r',
reasonml: 'reasonml',
ruby: 'ruby',
rust: 'rust',
sas: 'sas',
scala: 'scala',
scheme: 'scheme',
scss: 'scss',
shell: 'shell',
smalltalk: 'smalltalk',
sml: 'sml',
sqf: 'sqf',
sql: 'sql',
stan: 'stan',
stata: 'stata',
swift: 'swift',
tap: 'tap',
tcl: 'tcl',
twig: 'twig',
typescript: 'typescript',
vala: 'vala',
vb: 'vbnet',
verilog: 'verilog',
vhdl: 'vhdl',
viml: 'vim',
xml: 'xml',
xquery: 'xquery',
yaml: 'yaml',
};
export const LINES_PER_CHUNK = 70;
export const BIDI_CHARS = [
'\u202A', // Left-to-Right Embedding (Try treating following text as left-to-right)
'\u202B', // Right-to-Left Embedding (Try treating following text as right-to-left)
'\u202D', // Left-to-Right Override (Force treating following text as left-to-right)
'\u202E', // Right-to-Left Override (Force treating following text as right-to-left)
'\u2066', // Left-to-Right Isolate (Force treating following text as left-to-right without affecting adjacent text)
'\u2067', // Right-to-Left Isolate (Force treating following text as right-to-left without affecting adjacent text)
'\u2068', // First Strong Isolate (Force treating following text in direction indicated by the next character)
'\u202C', // Pop Directional Formatting (Terminate nearest LRE, RLE, LRO, or RLO)
'\u2069', // Pop Directional Isolate (Terminate nearest LRI or RLI)
'\u061C', // Arabic Letter Mark (Right-to-left zero-width Arabic character)
'\u200F', // Right-to-Left Mark (Right-to-left zero-width character non-Arabic character)
'\u200E', // Left-to-Right Mark (Left-to-right zero-width character)
];
export const BIDI_CHARS_CLASS_LIST = 'unicode-bidi has-tooltip';
export const BIDI_CHAR_TOOLTIP = __(
'Potentially unwanted character detected: Unicode BiDi Control',
);
export const HLJS_COMMENT_SELECTOR = 'hljs-comment';
export const HLJS_ON_AFTER_HIGHLIGHT = 'after:highlight';
|