feat(renderers): ordered list item start values
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, is this solved by this PR?
https://github.com/danomatic/react-pdf-html/pull/98
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.
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:
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. 🤷
This is in the latest version 2.1.0. Please test it out and confirm that it's working correctly!
Very sorry for the inconvenience, I made a bug, fixed it here: #102
Everything worked fine with minified html. Please excuse my oversight.