Skip to content

[BUG] Mouse selection highlights wrong text #182

@3f6a

Description

@3f6a

Write the following inline equation in Obsidian (this is just an example):

$\epsilon_{i} = \zeta_{+}U_{i}^{+} + \zeta_{-}U_{i}^{-}$

Now try to select this equation, by clicking on the right end (just before the ending $) and dragging the mouse (with the click held) to the left, until the beginning (just after the first $). Do not include the $'s in the selection. Then, you will see the following gets highlighted as the selection:

Screenshot 2023-08-26 at 01 36 46

which is wrong of course because we wanted to select the full equation, not just this portion. Apparently the concealment confuses the selection highlight logic. In fact, in reality the full equation is selected, as you can check by doing Ctrl+C and Ctrl+V somewhere, the full equation gets pasted.

So the bug is only visual, the selected "highlighted" text does not correspond to the actual selected text. I think it's related to how concealment expands those greek letters when selected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstreamSomething not possible or wrong with mathjax (math), obsidian or codemirror 6 (editor)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions