gitbook icon indicating copy to clipboard operation
gitbook copied to clipboard

Issue with online editor when writing Chinese characters

Open hatsune-miku opened this issue 6 months ago • 2 comments

Bug description

When writing in Chinese, the slate's (the editor implementation behind gitbook) internal data structure is randomly corrupted, leading to unstability like:

  • Unable to delete characters using Backspace
  • Unable to insert new lines using Enter
  • Editor stop responding to keyboard events
  • Web page refreshes itself (possibly a js exception occurred)

In some cases a F5 will help but in other cases the entire page is corrupted and I have to screenshot everything, create new page and retype them (copy & paste can stop working, too).

How to reproduce

I didn't find a determined path to reproduce a slate internal corruption but these steps may help:

  1. Use a Chinese IME
  2. Type both Chinese and English
  3. Do some delete and insert
  4. Then the problem will be very likely to appear

Additional context

  • This happens every 2 lines of text in average.
  • Any Chinese IME is ok - for example, the Windows 11 builtin IME.
  • I can write original markdown or HTML and sync content to git book but it's far less convenient.
  • Not all slate-based editors have this problem.

hatsune-miku avatar Jun 23 '25 09:06 hatsune-miku

@viktorrenkema Was this similar to the issue you were looking into?

addisonschultz avatar Jun 23 '25 11:06 addisonschultz

This happens with Vietnamese too, using either the Windows 11 Telex IME or the third-party UniKey IME. It didn't use to happen -- I have typed a whole bunch of Vietnamese on one of my sites a few months ago.

The only way I can type Vietnamese now is outside of GitBook and then paste it in. If I type inside, it corrupts the text all over the place, and if I edit the text with other text ahead of the cursor, Heaven and Hell will be rent asunder

fazzaan avatar Oct 29 '25 06:10 fazzaan