With ListStyles enabled, modeling throws TypeError if a list is preceded by non-tagged content #8262
Closed
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
- Given the above source HTML data
- 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