Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider including bi-directional text controlling characters to specialChars #6967

Closed
nchevobbe opened this issue Jul 22, 2022 · 0 comments
Closed

Comments

@nchevobbe
Copy link
Contributor

nchevobbe commented Jul 22, 2022

When reading code, those characters, if not treated as special chars, can make it quite challenging to understand what's going on (e.g. see https://raw.githubusercontent.com/nickboucher/trojan-source/main/JavaScript/stretched-string.js , which is derived from an example in https://trojansource.codes/)

To avoid confusion, I was wondering if the following chars could be put in the default specialChars regex [1]:

  • \u202d LEFT-TO-RIGHT OVERRIDE
  • \u202e RIGHT-TO-LEFT OVERRIDE
  • \u2066 LEFT-TO-RIGHT ISOLATE
  • \u2067 RIGHT-TO-LEFT ISOLATE
  • \u2069 POP DIRECTIONAL ISOLATE

[1]

option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, (cm, val, old) => {

marijnh added a commit to codemirror/view that referenced this issue Jul 22, 2022
FIX: Make `highlightSpecialChars` replace directional isolate characters by default.

Issue codemirror/codemirror5#6967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant