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

Feat: add additional ordered list options #1183

Merged
merged 4 commits into from
Oct 9, 2024

Conversation

jose-elias-alvarez
Copy link
Contributor

@jose-elias-alvarez jose-elias-alvarez commented Oct 5, 2024

Closes #744.

This PR adds two new options to enable the following Ordered List Style linter behaviors:

  1. Ordered list numbering is left as-is. This is useful if you want to enable Ordered List Indicator End Style / other potential future options but want manual control over numbers.
  2. Ordered list numbering keeps the initial indicator number from each list. This is the behavior I was looking for, though I didn't realize at first that it's slightly different from what was requested in FR: Allow Ordered List Style to Optionally Update Numbers #744., since it still allows fixing lists that don't adhere to the chosen Number Style option.

I initially implemented the 2nd behavior as an additional Number Style choice, but to my surprise, Obsidian actually handles lazy numbering when a list starts at a value other than 1 (it increments from there). I don't know how useful this behavior is in practice, but let me know if there's anything you'd like me to change in terms of the implementation or wording.

@pjkaufman
Copy link
Collaborator

Thanks for the PR @jose-elias-alvarez! I will need to take a look at this a little more and test it out. If it works for me, I will see about merging it.

Copy link
Collaborator

@pjkaufman pjkaufman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few minor suggestions. But beyond them, this looks pretty good!

src/lang/locale/en.ts Outdated Show resolved Hide resolved
src/lang/locale/en.ts Outdated Show resolved Hide resolved
src/lang/locale/en.ts Outdated Show resolved Hide resolved
src/utils/mdast.ts Outdated Show resolved Hide resolved
src/rules/ordered-list-style.ts Outdated Show resolved Hide resolved
src/rules/ordered-list-style.ts Outdated Show resolved Hide resolved
src/rules/ordered-list-style.ts Outdated Show resolved Hide resolved
src/rules/ordered-list-style.ts Outdated Show resolved Hide resolved
src/utils/mdast.ts Outdated Show resolved Hide resolved
@pjkaufman
Copy link
Collaborator

Thanks for making this change @jose-elias-alvarez ! I will go ahead and merge this.

@pjkaufman pjkaufman merged commit 7e888a5 into platers:master Oct 9, 2024
1 check passed
@jose-elias-alvarez
Copy link
Contributor Author

Thank you!

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.

FR: Allow Ordered List Style to Optionally Update Numbers
2 participants