Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291228

[upstream] Use CKEditor 5's native <ol type> and <ul type> UX

$
0
0

Problem/Motivation

We "solved" the problem of supporting <ol type> and <ul type> by using the SourceEditing functionality for that.

But in CKEditor 5 32.0.0, they've added a native UX for setting the list type:

Which means that rather than having to edit HTML by hand, the content creator can now do that through the UI! But unfortunately, it currently always generates <ol style="list-style-type:SOMETHING"> and <ul style="list-style-type:SOMETHING">, so we cannot use this.

This is blocked on https://github.com/ckeditor/ckeditor5/issues/11615. This is blocked on https://github.com/ckeditor/ckeditor5/issues/14613 per #20 (thanks @s_leu!).

It'd also improve the upgrade path from CKEditor 4 because these attributes would no longer have to get set through the SourceEditing functionality.

Steps to reproduce

N/A

Proposed resolution

See above.

Remaining tasks

  1. Set styles.useAttribute = true per https://github.com/ckeditor/ckeditor5/issues/11615, this ensures the type attribute will be generated instead of a style attribute
  2. Add configuration to \Drupal\ckeditor5\Plugin\CKEditor5Plugin\ListPlugin::buildConfigurationForm(), to allow enabling the type attribute or not
  3. Expand the config schema under ckeditor5.plugin.ckeditor5_list in ckeditor5.schema.yml
  4. Expand unit test coverage in \Drupal\Tests\ckeditor5\Unit\ListPluginTest
  5. Update path (+ tests) to automatically enable this if and only if they were previously allowing <ol type> or <ul type> to be set
  6. Optional: add more configuration to \Drupal\ckeditor5\Plugin\CKEditor5Plugin\ListPlugin::buildConfigurationForm(), to allow configuring which list type attribute values are allowed. (e.g. type="A" for <ol> or type="circle" for <ul>).→ CKEditor 5 does not yet support restricting this to specific types.

User interface changes

Extra configuration in UI:

API changes

None.

Data model changes

None.

Release notes snippet

Previously, setting <ol type> or <ul type> required manually writing HTML in CKEditor 5's "Source Editing" view. Now, the native UI functionality is available to set list style types for ordered lists (letters and Roman numerals instead of only numbers) and unordered lists (circles and squares instead of only discs).


Viewing all articles
Browse latest Browse all 291228

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>