I am copy pasting the image from clipboard. Then perfrom the ajaxt call to store the image in db and construct the image tag as mentioend below.
var imageTag = '<img src="RetrieveImageServlet?imgId='+imageId+'&docId='+docId+'"></img>';
I inserted the img tag html in various mode ,
CKEDITOR.instances.editorDocContent.insertHtml(imageTag);
CKEDITOR.instances.editorDocContent.insertHtml(imageTag,'unfiltered_html');
CKEDITOR.instances.editorDocContent.insertHtml(imageTag,'html');
CKEDITOR.instances.editorDocContent.insertHtml(imageTag1 ,'text');
I checked the img tag inserted into the editor by logging in console
console.log(" After image insert " + CKEDITOR.instances.editorDocContent.document.getBody().getHtml());
And below is the result of the console log the closing </img> is removed , looks like bug in CKEditor .
<p><img src="RetrieveImageServlet?imgId=443&docId=682" data-cke-saved-src="RetrieveImageServlet?imgId=443&docId=682"><p>
Then I modified the code as follows removed </img> tag and added trailing slash '/'
var imageTag = '<img src="RetrieveImageServlet?imgId='+imageId+'&docId='+docId+'" />';
Again the trailing / is remvoed by CKEditor waste lot of time to fix this product issue in CKEditor 4.
Anybody can help on this
Anybody can help on this
Hi Nirmal,
Hi Nirmal,
this is a community forum -- which means that users help one another when they know an answer to a question, if and when they have time.
Quick and professional-level support from the CKEditor team is only provided for commercial license owners through a dedicated support channel. Visit the CKSource site for more information, please.
Update: As a matter of fact, Margaret from the CKSource team said she will get in touch with you regarding your license renewal. Hope this will make it easier and quicker for you to solve your issue.
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
When did <img> started having
When did <img> started having a closing tag?
the only bug is in your code if it expects invalid HTML to work!
I pass the html retrieved frm
I pass the html retrieved frm CKEditor to IText XML Worker to generate the PDF and that is where I have issue , its throwing that there is no end tag for IMG
The problem is both the end slash \ is removed from img tag and when the </img> is used then that also get truncated by CKEditor.
If you check any description
If you check any description about CKEditor like here: http://ckeditor.com/about you'll find that CKEditor is an HTML editor and imgs doesn't have a closing tag in HTML.
Obviously if you try to use HTML in a XML tool you will find these kind of problems.
The problem is the html
The problem is the html retrieved from CKEditor is as shown below ,
<p><img src="RetrieveImageServlet?imgId=443&docId=682" data-cke-saved-src="RetrieveImageServlet?imgId=443&docId=682"></p>
But I should get html which has img tag with the trailing slash as mentioned below which is not happening.
<p><img src="RetrieveImageServlet?imgId=443&docId=682" data-cke-saved-src="RetrieveImageServlet?imgId=443&docId=682" /> </p>
Have you checked the Output
Have you checked the Output Formatting article?
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
I already tried this but no
I already tried this but no luck. Finally I am using the JTidy to resolve the issue it will be better if CKEditor provide the output in XHTML compliant format or API to get the same rather than using the third party libraries likeJTidy etc.,
var writer = editor.dataProcessor.writer;
writer.selfClosingEnd = ' />';