Skip to content

With ListStyles enabled, modeling throws TypeError if a list is preceded by non-tagged content #8262

Closed
@KevinMc

Description

📝 Provide detailed reproduction steps (if any)

We've got a variety of legacy HTML data created with older rich text editors, some of which contains elements that aren't surrounded by element tags. For example:

If there are missing paragraph or other tags prior to a list
<ol>
    <li>Item one</li>
</ol>
Then the editor won't model
  1. Given the above source HTML data
  2. Load an editor with the ListStyles plugin enabled

✔️ Expected result

The content should be modeled and editable by the editor.

❌ Actual result

A TypeError occurs:

TypeError: Cannot read property 'getAttribute' of null
    at Tm (ckeditor.js:5)
    at Pm.setAttribute (ckeditor.js:5)
    at Yp.t.on.priority (ckeditor.js:5)
    at Yp.fire (ckeditor.js:5)
    at Yp._convertItem (ckeditor.js:5)
    at Yp._convertChildren (ckeditor.js:5)
    at Yp.<anonymous> (ckeditor.js:5)
    at Yp.fire (ckeditor.js:5)
    at Yp._convertItem (ckeditor.js:5)
    at Yp._convertChildren (ckeditor.js:5)

If the ListStyles plugin is disabled, then the editor functions as expected.

📃 Other details

  • Browser: Chrome 86
  • OS: macOS 10.15
  • CKEditor version: 22.0.x
  • Installed CKEditor plugins: Bold, Italics, List, ListStyles
  • Build ID: eom5f2mlp9sw-494y9pll8mj2

Metadata

Assignees

Labels

package:listsquad:coreIssue to be handled by the Core team.type:bugThis issue reports a buggy (incorrect) behavior.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions