CKEditor 5 - Style definition for UL

Viewed 51

I have the style plugin installed on ckeditor5 and for elements with one level, like a paragraph, it works great but with something like a list, it doesn't (or doesn't for me!) The reason seems to be that for something like

<ul>
  <li>Hello</li>
  <li>World</li>
</ul>

When in the editor, it sees you as in the li, because if I do my definitions as such

var definitions = 
[
  {
    name: 'Info box',
    element: 'p',
    classes: [ 'info-box' ]
  },
  {
    name: 'Item List',
    element: 'li',
    classes: [ 'item-list' ]
  },
];

The style is enabled when I'm in the list but when I pick it, it puts the style on the li, when I need it on the ul.

If I make the definition like this

var definitions = 
[
  {
    name: 'Info box',
    element: 'p',
    classes: [ 'info-box' ]
  },
  {
    name: 'Item List',
    element: 'ul',
    classes: [ 'item-list' ]
  },
];

It's never enabled, because it's never seen as in the UL, just the LI.

Any pointers would be much appreciated.

0 Answers
Related