Opened 8 years ago
Closed 8 years ago
#16762 closed Bug (invalid)
data-cke- ... in normal link, image, anchor link
Reported by: | michel | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
First I did not found the link for posting tickets here. My mistake. I had first posted this problem on https://github.com/ckeditor/ckeditor-sdk/issues/206, someone there gave me this link.
I got a very recent version of the CKEditor that I did NOT adapt, I left it in its original state as I downloaded it. I did add one line of code in the config.js file : config.allowedContent=true; I use "inline editing".
I have to delete through PHP those data-cke-saved... that I found in a link or an image. Now I saw that I got this in an anchor link also : in an anchor link: data-cke-real-element-type="anchor"... in a normal link: data-cke-saved-href... in an image tag: data-cke-saved-src...
After adding an anchor link in the editable area WITHOUT saving it is shown as <a id="testing" name="testing"></a>, after saving see below (== Actual result ==).
I disabled other javascripts but it makes no difference, so there's no interference from other javascript.
I got an example in an attached file of how I saved into the database.
I'll be happy to answer any question or to give you any other file that you need.
Steps to reproduce
- just adding an anchor link in a editable are (see attached file)
- saving through a javascript (see attached file)
- saved into database with normal PHP code (see attached file)
- IMPORTANT : I reload the page and when I click in the editable area the CKEditor menu appears and click on the "Source" button (see picture as attached file), the anchor code is normal. But when I click on the right button of my mouse and choose "View page source" (see picture as attached file), the code for anchor link are those strange code data-cke- and has become an image as well (see below == Actual result ==).
It is saved this way into the database (see picture as attached file) Any ideas ?
Expected result
<a name="testing"></a>
Actual result
Once I retrieve it from the database (and it was saved this way into the database) : <img data-cke-real-element-type="anchor" src="data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==" title="Anchor" alt="Anchor" data-cke-real-node-type="1" data-cke-realelement="%3Ca%20data-cke-saved-name%3D%22testing%22%20name%3D%22testing%22%20id%3D%22testing%22%3E%3C%2Fa%3E" class="cke_anchor" align="">
Other details (browser, OS, CKEditor version, installed plugins)
Firefox 47.0.1, OS Win 7, CKEditor 4.6.1 (revision 580bcaf), Standard CKEditor + Plugins : Code Snippet, Color Button, Div Container Manager, File Tools, Font Size and Family, Indent Block, Insert <pre> element, Insert symbol, Justify, Letter-spacing, Line Height, List Style, Quicktable, Show Blocks, Simple HTML5 Audio, Source Dialog, Table Resize, Text Transform, Upload Widget, Youtube Plugin
Attachments (1)
Change History (2)
Changed 8 years ago by
Attachment: | code-JS-PHP-saving-into-DB-PICTURES.docx added |
---|
comment:1 Changed 8 years ago by
Keywords: | data-cke removed |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Version: | 4.6.1 |
Please always use http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getData to clean HTML before sending.
If you are building CKEditor on textarea please use the http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-updateElement and then http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getData
Pictures and codes JS and PHP for saving into DB