springload / draftail

📝🍸 A configurable rich text editor built with Draft.js

Home Page:https://www.draftail.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow mixing UL and OL when nesting

jmfederico opened this issue · comments

This is a bug report.

Current behavior

When changing the list type of a nested list between ol and ul, the new type of list will break from its parent, and create a new list without nesting.

  1. unordered list with nested unordered list
    1
  2. nested unordered list changed to ordered list
    3

Expected behavior

Changing the type of list for a nested list should keep it as nested.

Using WagTail 2.6.1

Hey @jmfederico, thanks for reporting this.

I think it might be possible to implement what you’re suggesting but I’m not entirely sure. I think the problem here is that the editor and content conversion to HTML need a way to tell where a list starts and when it ends.

Could you provide examples of other editors that work as you expect? Ideally from the list here: https://github.com/springload/draftail/blob/master/docs/CONTRIBUTING.md#discussing-the-editors-behavior

Edit: tagging this as an enhancement – I don’t think the current behavior of the editor suggests in that it’s meant to work as you expect but is broken. From an implementation perspective the current behavior is also completely intentional.

From the list of provided editors:

No nesting

  • Slate, does not allow nesting.

Nests incorrectly

These allow for mixed nesting, but reset the counter when un-nesting.

  • Quill
    quill

  • Dropbox Paper
    dropbox-paper

Work as expected

  • TinyMCE
    tinymce

  • Github
    github

  • Google Docs
    google-docs

  • Pages
    pages

  • CKEditor
    ckeditor

  • Word
    word