Skip to content

Commit

Permalink
Include more direction-related characters in special chars
Browse files Browse the repository at this point in the history
FIX: Make `highlightSpecialChars` replace directional isolate characters by default.

Issue codemirror/codemirror5#6967
  • Loading branch information
marijnh committed Jul 22, 2022
1 parent dd87c35 commit b951d62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/special-chars.ts
Expand Up @@ -28,7 +28,7 @@ interface SpecialCharConfig {
}

const UnicodeRegexpSupport = /x/.unicode != null ? "gu" : "g"
const Specials = new RegExp("[\u0000-\u0008\u000a-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\ufeff\ufff9-\ufffc]", UnicodeRegexpSupport)
const Specials = new RegExp("[\u0000-\u0008\u000a-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]", UnicodeRegexpSupport)

const Names: {[key: number]: string} = {
0: "null",
Expand All @@ -46,6 +46,9 @@ const Names: {[key: number]: string} = {
8232: "line separator",
8237: "left-to-right override",
8238: "right-to-left override",
8294: "left-to-right isolate",
8295: "right-to-left isolate",
8297: "pop directional isolate",
8233: "paragraph separator",
65279: "zero width no-break space",
65532: "object replacement"
Expand Down

0 comments on commit b951d62

Please sign in to comment.