diplodoc-platform / transform

Simple transformer YFM (Yandex Flavored Markdown) to HTML.
MIT License
50 stars 34 forks source link

Incorrect numbering in the ordered lists #443

Open MaxTyulin opened 2 weeks ago

MaxTyulin commented 2 weeks ago

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

shevnv commented 2 weeks ago

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.