Opened 8 years ago
#16879 new Bug
Creating a fakeElement with attributes doesn't work anymore (attributes are removed)
Reported by: | vosmanz | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.6.2 |
Keywords: | Cc: |
Description
I have a plugin that creates a div with some attributes as a fakeElement. The content of this div is only an ID. With the combination of the attributes and the ID I can later retreive dynamic contents from the database and replace the div-element. This plugin used to work, but after updating CKEditor from 4.5.7 to stable (4.6.2) it stopped working. After the update, it only inserts a div element with the ID as content. So all attributes are removed.
Steps to reproduce
- Download I used for 4.6.2: https://github.com/ckeditor/ckeditor-dev/archive/stable.zip
- Download I used for 4.5.7: https://github.com/ckeditor/ckeditor-dev/archive/4.5.7.zip
- Unzip CKEditor
- Unzip the attached plugin to ckeditor/plugins/gadget folder
- In config.js:
- Disable content filter: config.allowedContent = true;
- Add 'gadget' to config.plugins
- Create a toolbar: config.toolbar = [ { name: 'Gadget', items: [ 'Source', 'gadget' ] } ];
- Open the ckeditor/samples/ page in the browser
- Empty the content of the editor
- Click the 'Add gadget' button in the toolbar (blue gear)
- Type something in the textarea and click OK
- Click the Source button in the toolbar
Expected result
In CKEditor 4.5.7, the HTML code includes a div with attributes: <div class="gadgetPlugin tab-htmlcode" height="80" title="Gadget" width="80">1</div>
Actual result
In CKEditor 4.6.2, the HTML code includes a div without attributes: <div>1</div>
Other details (browser, OS, CKEditor version, installed plugins)
- Tested in Windows 10 PRO x64 (dutch), IE11
- Note that the plugin is a stripped version of the actual plugin, to demonstrate the problem only. The actual plugin retreives dynamic content of our server using Ajax, this version only uses some static content and has a lot of options and tabs removed.
Demo plugin