#9299 closed Bug (invalid)
HTML Editor Control (not parsing some of the Tags Correctly) - Help Required
Reported by: | Manish Chhetia | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.6.4 |
Keywords: | Cc: | manish.chhetia@… |
Description
Hi CKEditor Technical/Support Team,
Greetings of the day. I am looking for a good HTML Editor Control for my project specific requirements (in C# - ASP.Net). In relation to it; we are analyzing the CKEditor Control. Overview of the requirements for your reference are as follows: We have saved some of the Wod Document files as HTML (using Save-As of Word Application). After converting the word document to HTML; we assign the HTML text to Editor control (for editing/saving/printing).
We have tried to use CKEditor control for it; but the control incorrectly shows the table, images, checkboxes etc. *Checkboxes are not identified. Also the Editor controls shows some of the characters; as special character (like ‘<<’ is not parsed correctly etc.).
Is there something which we are missing for correctly using the control? Please If we can get the limitations of the HTML Editor control; Or if we can get a list of tags which are not supported by editor; for better evaluating the control.
For a simple execution of requirements :
- Please create any Word (Office 2007) Document having :
o An image o A check box o A simple table o Some text like ( <<Field1>>, <<Field2>> etc).
- Now use Save As option and save the document as an HTML.
- Please try to open this HTML in the Editor control; you will get an idea of the actual issue.
Here are the technical details of how we have used the control:
Designer Level :
<CKEditor:CKEditorControl ID="CKEditorControl1" runat="server" Toolbar="Basic"
Width = "100%" Height="500px" ToolbarBasic="Preview|Print|" Visible="False"></CKEditor:CKEditorControl>
Code Level (On Button Click Event) this.CKEditorControl1.Text = HTMLConvertedText;
Thanks and Regards, Manish Chhetia Senior Consultant, Capgemini. Mobile : + 91 992 296 5570
Attachments (3)
Change History (7)
comment:1 Changed 12 years ago by
Changed 12 years ago by
Attachment: | Sample Document.docx added |
---|
Word Sample Document (converted to HTML)
comment:2 Changed 12 years ago by
Please find the sample document attached herewith; the document is programmatically converted into HTML and them the HTML is supplied to the CKEditor control.
Please feel free to include any table/checkbox using Word in it.
Changed 12 years ago by
Attachment: | Sample Document2.docx added |
---|
Changed 12 years ago by
Attachment: | savedSamples.zip added |
---|
comment:3 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
I have added checkbox to word file as described in http://www.word-2010.com/insert-a-check-box-in-microsoft-word-2010/. Here are my findings:
- You say you converted doc to html. Please have a look at saved samples - this HTML has absolutely no information about correct tags. There are only paragraphs. A much better results can be obtained when pasting contents of doc file through pasteFromWord plugin.
Please note two things:- You need to have config.pasteFromWordRemoveFontStyles=false; and config.pasteFromWordRemoveStyles=false; set to false in your config.js file.
- In all cases, the editor privileges semantics over formatting, so the end results will never look like the original. CKEditor makes it best to translate the information send from Word through the clipboard and many times it needs to come to an agreement. In those cases we prioritize semantics instead of formatting.
- Please note that images have local path like
file://
while CKEditor works in browser. To get images working you have to first upload them to server. This is how it works in webapps. CKFinder could be used for that (http://ckfinder.com/demo) You can always create your own plugin that will upload images in background and change loacl path to URL while you paste from word.
- It seems that even pastefromword plugin does not recognize checkboxes pasted from Word. For that you might want to modify file
ckeditor\plugins\pastefromword\filter\filter.js
or create your own filter.
I think that this extra code in filter should look for word code like
<p class="MsoNormal"><p class="MsoNormal"><!--[if supportFields]><span lang=EN-US><span style='mso-element:field-begin'></span><span style='mso-bookmark:Check1'><span style='mso-spacerun:yes'> </span>FORMCHECKBOX </span></span><![endif]--><span lang="EN-US"><!--[if !supportNestedAnchors]--><a name="Check1"></a><!--[endif]--><!--[if gte mso 9]><xml> <w:data>FFFFFFFF650000001400060043006800650063006B003100000000000000000000000000000000000000000000000000</w:data> </xml><![endif]--></span><!--[if supportFields]><span style='mso-bookmark: Check1'></span><span style='mso-element:field-end'></span><![endif]--><span lang="EN-US">checkbox1<o:p></o:p></span></p> <p class="MsoNormal"><!--[if supportFields]><span lang=EN-US><span style='mso-element:field-begin'></span><span style='mso-bookmark:Check2'><span style='mso-spacerun:yes'> </span>FORMCHECKBOX </span></span><![endif]--><span lang="EN-US"><!--[if !supportNestedAnchors]--><a name="Check2"></a><!--[endif]--><!--[if gte mso 9]><xml> <w:data>FFFFFFFF650000001400060043006800650063006B003200000000000000000000000000000000000000000000000000</w:data> </xml><![endif]--></span><!--[if supportFields]><span style='mso-bookmark: Check2'></span><span style='mso-element:field-end'></span><![endif]--><span lang="EN-US">checkbox2<o:p></o:p></span></p>
and change it to correct checkbox tag.
This bug report is invalid. I think I will report separate issue for last point.
Could attach such file to this ticket and describe what is the outcome and what do you expect?
It is best if we will be looking at the same file that causes problems.
NOTE: The below is just to little information.