When using the italics button in the UI you can not properly italicise words in Chinese

AI-generated summary

The italics button in the UI doesn’t work properly for Chinese text due to the lack of spaces between words. Currently, the button generates markdown with underscores (_) instead of asterisks (*), resulting in incorrect formatting. seanblue proposed changing the italics button to use asterisks when text is highlighted and butts against another letter. sam welcomed the change, and fantasticfears has since merged the fix into the codebase (https://github.com/discourse/discourse/pull/7063).

In Chinese all words are rendered without spaces between them. Eg:

我喜欢精灵

Contains multiple words.

When you use the “italics” button in the UI to italicise a word we produce this markdown variant.

我_喜欢_精灵

This is unfortunate cause the spec allows for the following which would work as expected:

我*喜欢*精灵

Can we amend the italics button to use * if you have a section highlighted that butts against another letter.

2 Likes

Sure we are fine with the change described in the op, pr-welcome @fantasticfears if you feel like it.

2 Likes

3 posts were split to a new message: Sam stop editing my posts

It’s merged now. FIX: use * when apply italics in the editor instead of _ by erickguan · Pull Request #7063 · discourse/discourse · GitHub

6 Likes