Keep track of ordered list indexes and render them#1407
Conversation
|
Commonmark only pays attention to the first index in the list. So for example: Renders as https://spec.commonmark.org/dingus/?text=1.%20asdsad%0A3.%20asdasd%0A |
|
Seems so, would that be the preferred behavior? |
|
I wonder what the reason for that spec is. I once read that it reduces diffs when you remove an element in the middle of a large list, but that seems a rather niche concern. For a tool like haddock it seems preferable to give more control to the user. |
* Keep track of ordered list indexes and render them * Rename some identifiers to clarify
* Keep track of ordered list indexes and render them * Rename some identifiers to clarify
From my perspective it would have been better if this PR would never have landed, but that ship has sailed. I think the best bet for damage control is to do what CommonMark and GFM do and
as @mpickering pointed out. As for the motivating example from #1406, I think this is what definition lists are meant for. |
Currently, when ordered lists are parsed the sequence/index numbers of the list
items are discarded at the parser.
This PR changes
DocOrderedListto also keep track of the sequence number, andupdates the HTML and JSON (though I'm unsure on how changes to the JSON backend
should be dealt with) backends to include these. The hoogle backend remains
unchanged.
Resolves #1406