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: Move Math Block Indicators to Their Own Line duplicates text before block math delimiter #996

Closed
2 of 3 tasks
calofmijuck opened this issue Jan 17, 2024 · 6 comments · Fixed by #1002
Closed
2 of 3 tasks
Assignees
Labels
bug Something isn't working math Relates to math support in markdown

Comments

@calofmijuck
Copy link

calofmijuck commented Jan 17, 2024

  • I have verified that I am on the latest version of the Linter

Describe the Bug

The rule Move Math Block Indicators to Their Own Line duplicates text before block math delimiter.

How to Reproduce

Steps to reproduce the behavior:

  1. Create a new vault, enable community plugin, install this linter.
  2. Enable Lint on save rule for simplicity.
  3. Enable Move Math Block Indicators to Their Own Line Rule
  4. Write a$$b$$ in the editor.
  5. Save (or Lint the file)
  6. (Additionally) repeatedly linting the file keeps on duplicating the text before the block math delimiter.

Expected Behavior

Expected output if applicable:

a
$$
b
$$

Screenshots

Screen.Recording.2024-01-17.at.22.03.03.mov

Device

  • Desktop (MacOS)
  • Mobile

Additional Context

I checked the source code and found that this is actually a feature for math blocks inside blockquotes (>).
For blockquotes,

> $$a$$

should be linted to

> $$
> a
> $$

which is probably why the a in my example keeps getting duplicated. Is this intended behavior?

@calofmijuck calofmijuck added the bug Something isn't working label Jan 17, 2024
@pjkaufman
Copy link
Collaborator

Hey @calofmijuck . Thanks for reporting this issue. This is something that is not intended. It does seem to be caused by the blockquote logic. I will need to look at why it is running for non-blockquotes (probably an oversight on my part).

@pjkaufman pjkaufman added the math Relates to math support in markdown label Jan 27, 2024
@pjkaufman pjkaufman self-assigned this Jan 27, 2024
@pjkaufman
Copy link
Collaborator

I believe that I have a fix for this. It is still a work in progress since it is currently break some older UTs, but I am down to one broken UT now. Hopefully I can get that fixed and ready soon.

@pjkaufman
Copy link
Collaborator

Got it working. I just want to tackle one more scenario for blockquotes since that is a more complex scenario for knowing when to trim whitespace prior to the opening math block indicator because it was moved to a new line.

@pjkaufman
Copy link
Collaborator

I believe I have it tackled. I will go ahead and create a PR.

@pjkaufman
Copy link
Collaborator

I have merged the changes that should address this issue. This issue should be fixed on master and in the next release. Please let us know if that is not the case.

@calofmijuck
Copy link
Author

Thank you very much for looking into this bug. I truly appreciate your hard work. I hope you have an amazing weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working math Relates to math support in markdown
Projects
Archived in project
2 participants