Opened 8 years ago

Closed 8 years ago

#14369 closed Bug (invalid)

Inline Widget - Downcast/Upcast errors

Reported by: Gavin Roberts Owned by:
Priority: Normal Milestone:
Component: UI : Widgets Version:
Keywords: Cc:


Steps to reproduce

  1. Go to
  2. Place cursor within text.
  3. Click empty button on the left (note the red bordered box that appears)
  4. Click the Source button

Expected result

  1. All <span class="test"></span> blocks to be upcasted and converted into widgets.
  2. When clicking Source after adding a widget to the editor, it should show the source code.

Actual result

  1. Existing <span class="test"></span> blocks are removed.
  2. Throws Uncaught TypeError: Cannot read property 'attributes' of null


Uncaught TypeError: Cannot read property 'attributes' of null
    (anonymous function) @ plugin.js?t=FB99:2699
    window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.htmlParser.fragment.forEach @ ckeditor.js:260
    window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.htmlParser.fragment.forEach @ ckeditor.js:260
    window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.htmlParser.fragment.forEach @ ckeditor.js:260
    (anonymous function) @ plugin.js?t=FB99:2680
    h @ ckeditor.js:10 @ ckeditor.js:11 @ ckeditor.js:13
    window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.htmlDataProcessor.toDataFormat @ ckeditor.js:281 @ ckeditor.js:992
    (anonymous function) @ ckeditor.js:327
    h @ ckeditor.js:10 @ ckeditor.js:11 @ ckeditor.js:13 @ ckeditor.js:237 @ ckeditor.js:339
    (anonymous function) @ ckeditor.js:28 @ ckeditor.js:321 @ ckeditor.js:992
    window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.editable @ ckeditor.js:340
    window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.setMode @ ckeditor.js:307
    window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.plugins.sourcearea.commands.source.exec @ ckeditor.js:900
    exec @ ckeditor.js:174 @ ckeditor.js:236 @ ckeditor.js:742
    n.execute @ ckeditor.js:743
    (anonymous function) @ ckeditor.js:744
    (anonymous function) @ ckeditor.js:29 @ ckeditor.js:29
    onclick @ (index):1

Other details (browser, OS, CKEditor version, installed plugins)

Chrome, OS X, 4.5.6 and custom plugin - All code contained within

Change History (1)

comment:1 Changed 8 years ago by Jakub Ś

Keywords: inline removed
Resolution: invalid
Status: newclosed
Version: 4.5.6

Please see: and

Empty inline elements are considered garbage in CKEditor and are removed. This is core behaviour and is beyond widgets control (it is also not configurable). In order to avoid it please add simple &nbsp; to your widget template. You can later add (if your template has no content)/remove it in upcast/downcast methods.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy