summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/source_viewer/constants.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/source_viewer/constants.js')
-rw-r--r--app/assets/javascripts/vue_shared/components/source_viewer/constants.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/source_viewer/constants.js b/app/assets/javascripts/vue_shared/components/source_viewer/constants.js
index 9efe0147c37..bed6dd4d5c6 100644
--- a/app/assets/javascripts/vue_shared/components/source_viewer/constants.js
+++ b/app/assets/javascripts/vue_shared/components/source_viewer/constants.js
@@ -1,3 +1,5 @@
+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).
@@ -109,3 +111,26 @@ export const ROUGE_TO_HLJS_LANGUAGE_MAP = {
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',
+);