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

Desktop: Fixes #6822: Fix extra lines added to KaTeX source when toggling the rich text editor #8442

Merged

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

Updates the markdown-it KaTeX plugin such that it does not add an extra newline to the end of block math.

As I am no longer able to reproduce the code block portion of #6822, this should fix #6822.

Testing

Automated tests are included, however, to test this manually:

  1. Create a note with block math. For example,

    Test:
    $$ 3 + 3 $$
    
    More math:
    $$
        \int_0^1 \cos^2 x dx
    $$
    End test.
    
  2. Switch to the rich text editor, make a small change

  3. Switch back to the markdown editor

  4. Switch back to the rich text editor, make a small change

  5. Switch back to the markdown editor

Even if the math content changes between steps 1 and 3, it should remain the same between steps 3 and 5.

@laurent22
Copy link
Owner

Hmm I remember there was some other issue with these new lines which means fixing something would break something else, which is why it was left as it was. But that looks like a good change anyway so let's merge and see if we hear about any regression later on.

@laurent22 laurent22 merged commit 1691180 into laurent22:dev Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Writing in the WYSIWYG editor adds addtional new lines inside code and math expressions
2 participants