springload / wagtaildraftail

🐦📝🍸 Draft.js editor for Wagtail, built upon Draftail and draftjs_exporter
https://pypi.python.org/pypi/wagtaildraftail
MIT License
24 stars 3 forks source link

Investigate Wagtail 1.12 RichText Features #58

Closed loicteixeira closed 6 years ago

loicteixeira commented 6 years ago

Wagtail 1.12 will introduce Rich Text Features (see wagtail/wagtail#3736), a way to configure the features (format, heading, etc) of a rich-text editor per field. The underlying goal is to the editor config (which is kinda global, i.e. config for the whole Draftail editor) and the features of a given field (i.e. allowing different formatting options for the intro and body blocks). Eventually, features will also be hooked with whitelisting and text conversion logic (the ultimate goal of having all rich text editor saving content in a uniform way to avoid editor lock-in (I can't find the discussion around that anymore sorry)).

I'm not sure whether it's too early to start implementing such thing, but we should at least think of it as it might shuffle quite a few things.

thibaudcolas commented 6 years ago

Looking at the Draftail docs, most of the editor configuration could be handled with this "enabled / disabled" features list. The only field that's not on/off would be the list nesting threshold, but I think WagtailDraftail can have a "safe default" of 9 as we suggested in the past.

To leverage this feature, we will need an additional abstraction layer that is missing at the moment. I think that's very welcome anyway – most people shouldn't have to know about draftjs_exporter, or draftail. This abstraction layer may not hold up for people who want to create their own rich text features, but that seems fine.

loicteixeira commented 6 years ago

Work started in #63. Edit: Merged.