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: Paragraph blank lines Not Behaving Uniformly with Different List Indicators and Types #1014

Closed
liangzh-404 opened this issue Feb 18, 2024 · 6 comments · Fixed by #1028
Closed
Assignees
Labels
bug Something isn't working markdown General Markdown or Markdown related issue or feature reproducible resolution/update-made A change has been made that should resolve this issue or request

Comments

@liangzh-404
Copy link

before change:
image
after chagne
image

I personally think that the behavior of an ordered list makes more sense to me.

@liangzh-404 liangzh-404 added the question Further information is requested label Feb 18, 2024
@pjkaufman
Copy link
Collaborator

Hey @liangzh-404 . I believe that logic is entirely based on the parser itself. Could you provide the source content and before and after? Spacing matters at the end of each line, so that could cause the discrepancy you are seeing.

@liangzh-404
Copy link
Author

@pjkaufman test case I used

  • abc
    abc
    bb
  1. abc
    abc
    bb

@pjkaufman
Copy link
Collaborator

I took a look at the logic and I see the issue. This logic seems to have been written a ways back before we were properly handling all list types. It seems that it is properly recognizing ordered lists that start with numbers and have a period after them. But it is only looking for list items that start with - or - . So that logic needs to be updated to properly ignore all list items.

@pjkaufman pjkaufman added bug Something isn't working and removed question Further information is requested labels Feb 28, 2024
@pjkaufman pjkaufman self-assigned this Feb 28, 2024
@pjkaufman pjkaufman moved this from Backlog to In Progress in Obsidian Linter Feb 28, 2024
@pjkaufman
Copy link
Collaborator

Dev note:
Update the match regex for paragraph blank lines for list items to match all possible list item indicators (not having to be the very start of the line) and update the regex for ordered list items to also account for 9) and 9) as well since nested list items should also be ignored.

@pjkaufman
Copy link
Collaborator

I believe that I have a simple fix for this since we already have regex to check this exact scenario in one go: startsWithListMarkerRegex. I just need to add more UTs to make sure that all list item types (orderd, unordered, and check lists) get accounted for.

@pjkaufman pjkaufman added markdown General Markdown or Markdown related issue or feature reproducible labels Feb 28, 2024
@pjkaufman pjkaufman changed the title Question: why "Paragraph blank lines" have different behavior on ordered list and unordered list Bug: Paragraph blank lines Not Behaving Uniformly with Different List Indicators Feb 28, 2024
@pjkaufman pjkaufman changed the title Bug: Paragraph blank lines Not Behaving Uniformly with Different List Indicators Bug: Paragraph blank lines Not Behaving Uniformly with Different List Indicators and Types Feb 28, 2024
@github-project-automation github-project-automation bot moved this from In Progress to In Next Release in Obsidian Linter Feb 28, 2024
@pjkaufman
Copy link
Collaborator

I have merged in the potential fix. It should be in the next release and on master. Please let us know if there are any issues with either of them. Thanks!

@pjkaufman pjkaufman added the resolution/update-made A change has been made that should resolve this issue or request label Feb 28, 2024
@pjkaufman pjkaufman moved this from In Next Release to Released in Obsidian Linter Mar 6, 2024
@pjkaufman pjkaufman moved this from Released to Previous Release in Obsidian Linter Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working markdown General Markdown or Markdown related issue or feature reproducible resolution/update-made A change has been made that should resolve this issue or request
Projects
Archived in project
2 participants