Weird transformation of characters in default markdown editor: fi and fl

Hello,

I use Joplin 1.0.79 on arch linux installed from aur repo since some days.
I also use kde with default config.

All is fine but in markdown editor (default one), anytime I type
‘fl’ it becomes the character ‘fl’ in one character but the cursor is still shifted of 2 chars as if a space char was added.
Same thing happens with ‘fi’ which becomes ‘fi’ in 1 char.
Note: it only happens if both letters are in lower case.

  • I do not have this issue in any other editors
  • I do not see any info,debug,error in JS console of Joplin once in debug mode.

Thanks a lot if you could have an idea about this, cause it prevents to type some very simple words.

You need to set a monospace font for the editor, in the settings.

I think it has something to do with font ligatures. You can read more about that term here and here.

To disable font ligatures in the editor, you can add a few lines of CSS code below in your userchrome.css file.

.ace_content {
  font-variant-ligatures: none;
}

Maybe it’s not a monospace font that you use in the editor. As far as I know, the “f”-ligatures are not applied in monospace fonts.

1 Like

Thank you for help and guidance, it now works like a charm. Anyway, that is better :relaxed: , I can type again words like fix or flux or ...

Cheers, keep on the good work and support on joplin!

Having the same problem. It’s really surprising to have ligatures while editing (and, funny enough, not on the renders).

Perhaps this should be on the default CSS?

The default monospace generic editor font does not support ligatures, neither does the default viewer font (at least on my copy of Windows!). However if you specify a different editor font in "settings" that supports ligatures the Joplin editor will use them.

As I understand it the reason that the viewer does not display ligatures if a ligature font is selected in the editor settings is because the editor settings apply to the editor only. If you use userstyle.css (which applies to the viewer only) to apply a ligature supporting font, the viewer will subsequently render ligatures as well.

So by changing a combination of the above you can have ligature fonts in the editor, or the viewer, or both, or neither (default).

I think this is the key part I disagree with. I shouldn't have to go out of my way and strip ligatures from monospaced fonts [1] just because I don't want them used in Joplin's editor. But, I guess that's a product concern, and I should chase the right deciders if I want to do something about it.

[1]: Why a monospaced font thinks is a good idea to distribute ligatures is a separate discussion. idgi either :man_shrugging:

You should definitely take that up with ace-editor. It’s one of their bonehead design decisions and Joplin just happened to choose to build its editor on top of it.

Was just trying the Mermaid plug in and the --> was also getting partially converted. Looked really odd. This helped fix that display issue.

.ace_content {
  font-variant-ligatures: none;
}

Thanks!