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

fix #410 #411

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix #410 #411

wants to merge 1 commit into from

Conversation

FossPrime
Copy link

@FossPrime FossPrime commented May 11, 2022

Sandbox of this patch in action: https://stackblitz.com/edit/vitejs-vite-btuys7?file=main.js,index.html

Fix 410 by reducing the padding if the number of digits in the list grows. Also fixes issues with numbers over 99. Making the mid LI spacing adjustable is possible, but not part of this commit.

In deeply nested lists, indentation can still be broken for ordered lists over 99 nested inside other lists. A fix is difficult to implement without very very slow tree walking code.

This PR results in the following
Screenshot from 2022-05-11 14-42-35

without the PR the paragraph would be misaligned like the following:

9.  This is a paragraph in a list item.
    
    This is a paragraph in the same list item as above.
    
10.  A paragraph in a second list item.
    
    This is a paragraph in the same list item as above.

Which github would correctly render as the following unexpected code_block:

  1. This is a paragraph in a list item.

    This is a paragraph in the same list item as above.

  2. A paragraph in a second list item.

This is a paragraph in the same list item as above.

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.

1 participant