react-pdf-html icon indicating copy to clipboard operation
react-pdf-html copied to clipboard

feat(renderers): ordered list item start values

Open robbeman opened this issue 1 year ago • 3 comments

Adds support for the value property on list items to set the start value of the list. Will look back to previous items to check for start values. (A single list can have multiple start values in several places, so the loop will stop as soon as a start value is encountered.)

robbeman avatar Apr 18 '24 13:04 robbeman

@robbeman, is this solved by this PR?

https://github.com/danomatic/react-pdf-html/pull/98

danomatic avatar Jul 21 '24 20:07 danomatic

Not exactly, PR #98 handles the start attribute of the <ol> element.

This PR handles the value attribute of the <li> element, which can change the number of an element halfway through a list, allowing to skip numbers without breaking out of the parent <ol>.

Obviously there is some overlap, I'll see if I can easily resolve the merge conflict.

robbeman avatar Jul 22 '24 07:07 robbeman

Ok, I solved the merge conflict and in the meantime I noticed that the start value implementation did not support other list styles (alpha or roman). I moved the start value a little higher and that should do.

To demonstrate what the difference is between the start and the value property: image

I'm not sure if anybody in their right mind would make a list like the one in the screenshot, but now it is possible. 🤷

robbeman avatar Jul 22 '24 08:07 robbeman

This is in the latest version 2.1.0. Please test it out and confirm that it's working correctly!

danomatic avatar Aug 09 '24 01:08 danomatic

Very sorry for the inconvenience, I made a bug, fixed it here: #102

Everything worked fine with minified html. Please excuse my oversight.

robbeman avatar Aug 09 '24 08:08 robbeman