Skip to content

[Bug]: Incorrect key mapping: Cyrillic 'х' triggers bracket auto-closing in markdown code blocks #14059

@nomoreqwerty

Description

@nomoreqwerty

What happened?

When typing the Cyrillic letter 'х' (ha) inside a markdown code block, the editor inserts square brackets [] instead of the character. This happens because the Russian 'х' is located on the same physical key as [ on the US QWERTY layout

It seems the editor triggers the "auto-close brackets" feature based on the physical keycode, ignoring the current keyboard layout (Russian).

This works the same for the letter 'э' which is located on the same key as '

This issue affects both the desktop application and the web version

Steps to Reproduce:

  1. Create a code block in a document using triple brackets (```)
  2. Switch the keyboard layout to Russian
  3. Type the letter 'х' (located on the [ key) within the code block
  4. Type the letter 'э' (located on the ' key) within the code block

Expected Behavior:
When typed 'х' - Cyrillic character 'х' should be inserted
When typed 'э' - Cyrillic character 'э' should be inserted

Actual Behavior:
When typed 'х' - the editor ignores the layout and inserts square brackets []
When typed 'э' - the editor ignores the layout and inserts quotes ''

Keyboard Layout:
Russian / English (US)

Distribution version

Windows x64

App Version

0.25.5

What browsers are you seeing the problem on if you're using web version?

No response

Are you self-hosting?

  • Yes

Self-hosting Version

No response

Relevant log output

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 *Untriaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions