Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Enabling Conceal causes abnormal characters to be replaced when editing formulas. #368

Open
Abahabahabach opened this issue Jan 8, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@Abahabahabach
Copy link

Hi, dear Developer!

I've encountered a minor issue related to math formula editing while using your plugin, and I'd like to provide some feedback.

Issue Description

When I enabled the Conceal feature in the editor, after entering certain LaTeX commands in a math environment (e.g., $$...$$) followed by an ' character, abnormal replacement/rendering automatically occurs, resulting in strange characters or extra $’.

For instance, if I want to write:

$$

\alpha'

$$

It gets replaced with:

$$

\alpha

$

Similarly, the commands \nabla', \sum', \int' encounter the same issue, as long as there is a Greek letter or special symbol followed by an ', this phenomenon appears.

However, if it's an ordinary English letter, like a', it won't be incorrectly replaced.

Steps to Reproduce

  1. Enable the "Conceal" feature.

  2. Create/edit a markdown file, and input math environment:

$$

\alpha'

$$
  1. Observe the rendering or the actual text in the editor becoming:
$$

\alpha

$

Expected Behavior

Expect to keep \alpha' as is in the editor without unnecessary replacement of the ' character. Only in the preview rendering should the formulas be beautifully displayed without affecting the formula editing itself.

Temporary Solution

  1. After disabling the Conceal feature, editing formulas works normally without ' being changed to / $’.

Environment Information

  • Obsidian Version: 1.7.7

  • Plugin Version: 1.9.7

  • Operating System: macOS

Finally

Thank you very much for your work! If you need any further information or testing, I'm willing to assist anytime.
image

@Abahabahabach Abahabahabach added the bug Something isn't working label Jan 8, 2025
@Abahabahabach
Copy link
Author

Hello, through my investigation, I found the source of the problem. The reason is that the spell check in Obsidian was enabled, and simply disabling the spell check will prevent the error from occurring. I also tested it in the sandbox vault, and disabling the spell check solves the issue.

I suspect that there is a conflict between a certain feature of concealment and Obsidian's spell check.

@superle3
Copy link
Contributor

Does it get replaced or is it just visually different. Also what language is your spell check. I don't see this with my current languages (dutch, english (uk)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants