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

Styles disappear after insert is applied #2260

Closed
poincare15 opened this issue Jan 13, 2024 · 4 comments
Closed

Styles disappear after insert is applied #2260

poincare15 opened this issue Jan 13, 2024 · 4 comments
Assignees
Labels
bug Sponsored Requested by a sponsor

Comments

@poincare15
Copy link

poincare15 commented Jan 13, 2024

Step - 1: Write anything
Step - 2: Apply a style (color, background etc.)
Step - 3: Select the text.
Step - 4: Apply insert (sqrt, frac etc.)

Your applied styles disappear (colors, background, size, \displaystyle etc. removed)

Is this a bug?

style_bug

Mathlive version: 0.98.5
Browser: Chrome 120
OS: Windows 11

@arnog
Copy link
Owner

arnog commented Jan 13, 2024

Duplicate of #2104

@arnog arnog marked this as a duplicate of #2104 Jan 13, 2024
@arnog arnog self-assigned this Jan 13, 2024
@arnog arnog added the bug label Jan 13, 2024
@arnog arnog added the Sponsored Requested by a sponsor label May 19, 2024
@arnog
Copy link
Owner

arnog commented May 22, 2024

A detail worth adding: this happens if you select from right to left. If you select from left to right, you get the expected result.

@poincare15
Copy link
Author

poincare15 commented May 22, 2024

A detail worth adding: this happens if you select from right to left. If you select from left to right, you get the expected result.

Interestingly I got the same error in bug two directions. I think I'm doing something wrong.

My solution:
replace 'latex-unstyled' with 'latex'

: model.getValue(model.selection, 'latex-unstyled');

I solved it this way. I hope I didn't break anything else.

@arnog
Copy link
Owner

arnog commented May 22, 2024

That seems to be a different problem. I don't think this code path is used when following the steps in this bug report (i.e. selecting a subexpression, then typing something on the keyboard to replace it). It may be that using latex instead of latex-unstyled might be OK. I'll need to think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Sponsored Requested by a sponsor
Projects
None yet
Development

No branches or pull requests

2 participants