Zero-width non-joiner (ZWNJ) character shown as red dots in editor mode

Steps to reproduce

enter zero-width non-joiner in editor. or copy and paste next line:
‌‌ ‌‌ ‌‌ ‌‌

Expected result

What you should see is what is shown in the forum. A bunch of spaces with ZWNJ characters in between which are not visible.

Actual result

what actually happens is this:
Red dots replacing ZWNJ characters.


  • Operating system: windows 10 19041
  • Obsidian version: v0.10.9 (though it was present as long as I used obsidian.

Additional information

I also used the inspect element to see what it shows, it seems that CodeMirror puts it into this class block invalidchar. And in the styles section: .cm-invalidchar.
This is a pretty important character in languages where they have a complex writing system, like Persian and Arabic.


this is an upstream problem in codemirror editor. Btw, I saw your bug report there, you could have mentioned it.

We’ll wait until they fix it. It’s still present in their latest version. You can test it here.

1 Like

honestly, I don’t even remember that. I remembered Zettlr had the same problem, but I could not remember what it was!
But you are right, I should have looked into what it was back then and then made the topic.

This sounds like a big problem for Arabic/Farsi users. I wonder why we haven’t received more reports about this. Is there something unique about your setup/input method?

1 Like

The thing is that it is some thing non-essential. Most of the softwares out there doesn’t even support RTL. Which without one, writing in arabic and persian and hebrew is not an option. So the expectation is pretty low. (Let me not start about the few years of constantly bugging evernote team to persuade them to bringing back the RTL support, unfruitfully.)

Also you can just space instead, it is not a correct way of writing the words, but it will do.


The problem seems to got fixed in the version 5.59.3 of code-mirror.


will be fixed in 0.11.7

1 Like

Thank you very much!