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
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:
This is a paragraph in a list item.
This is a paragraph in the same list item as above.
A paragraph in a second list item.
This is a paragraph in the same list item as above.
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](https://user-images.githubusercontent.com/876076/167932625-1b4943af-a8ea-4f73-a4e1-4f964736a620.png)
without the PR the paragraph would be misaligned like the following:
Which github would correctly render as the following unexpected code_block:
This is a paragraph in a list item.
This is a paragraph in the same list item as above.
A paragraph in a second list item.
This is a paragraph in the same list item as above.