Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#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)

Sample Document.docx (28.6 KB) - added by Manish Chhetia 7 years ago.
Word Sample Document (converted to HTML)
Sample Document2.docx (37.0 KB) - added by Jakub Ś 7 years ago.
savedSamples.zip (24.5 KB) - added by Jakub Ś 7 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by Jakub Ś

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.

but the control incorrectly shows the table, images, checkboxes etc. *Checkboxes are not identified.

Changed 7 years ago by Manish Chhetia

Attachment: Sample Document.docx added

Word Sample Document (converted to HTML)

comment:2 Changed 7 years ago by Manish Chhetia

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 7 years ago by Jakub Ś

Attachment: Sample Document2.docx added

Changed 7 years ago by Jakub Ś

Attachment: savedSamples.zip added

comment:3 Changed 7 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

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:

  1. 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:
    1. You need to have config.pasteFromWordRemoveFontStyles=false; and config.pasteFromWordRemoveStyles=false; set to false in your config.js file.
    2. 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.
  1. 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.
  1. 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.

Last edited 7 years ago by Jakub Ś (previous) (diff)

comment:4 Changed 7 years ago by Jakub Ś

Last point reported in #9322

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy