diplodoc-platform/transform

Incorrect numbering in the ordered lists

MaxTyulin opened this issue · 1 comments

In split view, the numbers for nested elements look like 1 -> 1.1 -> 1.1.1, but in wysiwyg mode, each new element starts with 1.

with markup

1. a
    1. a.a
        1. a.a.a
    1. a.b
1. b

expected
image

real
image

it happens because transform has two mutually exclusive functionalities for numbered lists.
The first is feature for sublist with complex counters(1.1, 1.1.1 etc). it's enabled by default in diplodoc-platform/transform.
The second is functionality which give you opportunity to start list from any number, not only 1. It's enabled by default in markdown-it.

In wysiwyg, we had a lot of complains about disabled second functionality, so we disabled the first by adding class yfm_no-list-reset to wysiwyg root-node.

My suggestions, in this issue, Let's try to combine both functionalities, so It helps wisywig not to decide which functionality is more important.