From c3527035e140d7a4afc07737dc2fbb4f4cd1a684 Mon Sep 17 00:00:00 2001 From: Mitchel Date: Wed, 7 Feb 2024 01:05:32 +0100 Subject: [PATCH 1/2] fix: Include special characters in syntax highlighting --- app/javascript/src/lib/OWLanguageLegacy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/src/lib/OWLanguageLegacy.js b/app/javascript/src/lib/OWLanguageLegacy.js index c902e9fc8..502c2fe90 100644 --- a/app/javascript/src/lib/OWLanguageLegacy.js +++ b/app/javascript/src/lib/OWLanguageLegacy.js @@ -32,7 +32,7 @@ const punc = ":;,.(){}[]+-\\*" const octal = /^\-?0o[0-7][0-7_]*/ const hexadecimal = /^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/ const decimal = /^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/ -const identifier = /^\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1/ +const identifier = /^\$\d+|(`?)[_A-Za-zÀ-ÖØ-öø-ÿ][_A-Za-zÀ-ÖØ-öø-ÿ$0-9]*\1/ const actionsValuesIdentifier = /^\s*(?=[A-Z])\b[A-Z][\w\s-]*(?!:)/g const phraseIdentifier = /^\s*(?=[A-Z]).+?(?= [+\-*%=|&<>~^?!]|[\(\)\{\}:;,./\n\[\]]|\s==)/ const customKeywords = /(? Date: Wed, 7 Feb 2024 02:20:22 +0100 Subject: [PATCH 2/2] chore: Accept any latin character in identifier regex --- app/javascript/src/lib/OWLanguageLegacy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/src/lib/OWLanguageLegacy.js b/app/javascript/src/lib/OWLanguageLegacy.js index 502c2fe90..28d3334e9 100644 --- a/app/javascript/src/lib/OWLanguageLegacy.js +++ b/app/javascript/src/lib/OWLanguageLegacy.js @@ -32,7 +32,7 @@ const punc = ":;,.(){}[]+-\\*" const octal = /^\-?0o[0-7][0-7_]*/ const hexadecimal = /^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/ const decimal = /^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/ -const identifier = /^\$\d+|(`?)[_A-Za-zÀ-ÖØ-öø-ÿ][_A-Za-zÀ-ÖØ-öø-ÿ$0-9]*\1/ +const identifier = /^\$\d+|(`?)[\p{L}][_\p{L}$0-9]*\1/u const actionsValuesIdentifier = /^\s*(?=[A-Z])\b[A-Z][\w\s-]*(?!:)/g const phraseIdentifier = /^\s*(?=[A-Z]).+?(?= [+\-*%=|&<>~^?!]|[\(\)\{\}:;,./\n\[\]]|\s==)/ const customKeywords = /(?