logseq / logseq/logseq

Bracket auto-pair swallows Japanese IME input: typing 「 inserts [] instead

Open
#12,966 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
45k
Forks
2.8k
Avg merge
1d 22h
Merged PRs (30d)
105

Description

Search first
  • I searched and no similar issues were found
What Happened?

On the browser version and macOS desktop app with a Japanese input source active (Hiragana / かな), pressing the [ key should commit 「. Instead, Logseq's [ → [] autopair fires, preventDefault() cancels the IME's commit, and [] is inserted.

The result is that 「」, one of the standard Japanese quotation marks, cannot be typed in a block. The same key is shared between [ and 「, and Logseq claims it unconditionally. The same goes for other auto-paired characters such as $ or `.

Reproduce the Bug
  1. In test.logseq.com or Desktop app, switch the input source to Japanese (Hiragana).
  2. Click into a block to start editing.
  3. Press the [ key (the key that produces 「).
  4. [] is inserted with the cursor between the brackets; 「 is inserted in the middle, which is not the intended output

The same happens for $ and ` and other auto-paired characters.

Expected Behavior

With a Japanese input source active, the [ key produces 「 without the triggering of auto-pair.

Screenshots

https://github.com/user-attachments/assets/4233cc56-1006-411d-957e-259a8b3e117c

Desktop or Mobile Platform Information

Tested on both test.logseq.com and the latest macOS nightly.

Additional Context

Claude code was able to fix the code for me and I was able to confirm the fix locally.

However, I am not well versed in closure and posting code that I cannot verify myself seems irresponsible. Hit me with a comment if there is need for more information.

Are you willing to submit a PR? If you know how to fix the bug.
  • I'm willing to submit a PR (Thank you!)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name a file or test. First reproduce the behavior in test.logseq.com or the macOS desktop app with a Japanese Hiragana input source, then trace the editor's auto-pair handling for [, $, and `. Done means Japanese IME input commits 「 without inserting an auto-paired character, while ordinary auto-pairing still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, macos
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.