arnog / mathlive

A web component for easy math input
https://cortexjs.io/mathlive
MIT License
1.6k stars 280 forks source link

Blackboard style incorrectly serialized when input latex using physical keyboard #2535

Closed mathematicswizard closed 1 week ago

mathematicswizard commented 1 month ago

Steps to Reproduce Visit https://cortexjs.io/mathlive/demo/

  1. In the mathfield type \mathbb{N} with your physical keyboard then press Enter.
  2. The latex is rendered to characters.
  3. In the mathfield type any latex command (\subseteq, \forall etc') then press Enter.
  4. The latex is rendered to characters, as expected.
  5. Afterwards select the the entire string and press ESC to revisualize the latex.

Actual Behavior The result is `\mathbb{N\subseteq}

Expected Behavior The \subseteq should not be in blackboard style and the result should be: \mathbb{N}\subseteq.

Notes

I tested various scenarios: \mathbb{R}\vee\wedge a resulted in: \mathbb{R\vee\wedge} a

It seems to be incorporating the only latex commands in the environment of the Blackboard style.

This is following bug-fix #2533

Environment Mathlive 0.101.1

arnog commented 2 weeks ago

I've tried, but I've been unable to reproduce this problem as described. Maybe there's some additional steps that are missing?

I've only been able to cause an unexpected behavior by typing \mathbb{R}, then return, then \alpha, then return, the select all, then ESC.

mathematicswizard commented 2 weeks ago

Yes you are right. I made a mistake in the description. It's as you described. I'm updating my initial report.

mathematicswizard commented 1 week ago

Thank you very much!