zed icon indicating copy to clipboard operation
zed copied to clipboard

Non-English characters not displayed in Markdown links on Linux

Open jsparkdev opened this issue 1 year ago β€’ 7 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

As shown in the following image, characters such as Korean, Japanese, Chinese, and Arabic are not displayed correctly in the Linux Markdown link.

aa

Environment

Zed: v0.150.3 (Preview) OS: Linux Mint 22 Memory: 2451MiB / 31988MiB Architecture: x86_64 GPU: AMD ATI Radeon RX 470/480/570/570X/580/580X/590

jsparkdev avatar Aug 23 '24 06:08 jsparkdev

Can you provide an example block of text to help reproduce this issue?

notpeter avatar Sep 02 '24 00:09 notpeter

@notpeter Does this image not explain it well enough? If so, I'm not sure what more information is needed. 😭

360806043-296982dc-81d7-45e1-98ee-32e524b70460

jsparkdev avatar Sep 02 '24 07:09 jsparkdev

Was looking for an example of a plaintext string that I could copy paste from the github issue into my editor that triggers the issue. I don't have IME configured on my Linux machine and wanted to make sure I had a test case which triggered the issue. Something like:

[hello μ•ˆλ…•ν•˜μ„Έμš” δ½ ε₯½ Ω…Ψ±Ψ­Ψ¨Ω‹Ψ§](https://zed.dev)

notpeter avatar Sep 02 '24 12:09 notpeter

Oh, I see! Is it okay to provide a string like this?

The three strings below are Korean, Chinese, and Japanese, respectively.

[μ•ˆλ…•ν•˜μ„Έμš”](https://zed.dev)
[δ½ ε₯½](https://zed.dev)
[こんにけは](https://zed.dev)

jsparkdev avatar Sep 02 '24 13:09 jsparkdev

This works correctly on MacOS, but I am able to reproduce on Linux (Ubuntu 24):

  • Works in normal code.
  • Works in the markdown preview.
  • Broken inside the [brackets] of a link in markdown.

Screenshot_20240902_182213

Temporary workaround:

  "experimental.theme_overrides": {
    "syntax": {
      "link_text": {
        "font_style": "normal"
      }
    }
  },

Screenshot_20240902_182321

notpeter avatar Sep 02 '24 18:09 notpeter

@notpeter This method works! thank you

jsparkdev avatar Sep 03 '24 01:09 jsparkdev

Looks like the best place to fix this would be in the cosmic-text crate - see https://github.com/pop-os/cosmic-text/issues/114

Could probably be addressed on the Zed side here, but would be much cleaner to do this via augmenting cosmic-text's existing fallback logic. Specifically see use of FontFallbackIter in cosmic-text here

mgsloan avatar Nov 07 '24 06:11 mgsloan

I'm going this as stale as I believe it has been fixed by a cosmic-text upgrade.

If you're still seeing this please comment and I'm happy to reopen.

notpeter avatar Jul 02 '25 19:07 notpeter

I encounter the same problem when using Chinese characters in square brackets in the Markdown editor, while other cases work fine.

Image

System info:

Image

panhyuan avatar Aug 12 '25 02:08 panhyuan