Hello,
While developing web page with infragistics 15.2 WebHtmlEditor, with ASP.NET , I encountered an issue with copying paragraphs from MS Word in to editor. When we type in editor it would not put space between paragraphs (after we press enter) but when we copy a paragraph from MS Word it would show space (not a new line) between paragraphs.
And when we get the TextXhtml from editor, it would show different type of html tags for paragraphs. The paragraphs typed from editor are in <div></div> tags but paragraphs copied from MS word are within <p></p> tags which are again inside one <div></div> tag.
Ex:
<div>Typed from editor</div>
<div><p>copied from MS word</p><p>Copied from MS word</p></div>
Let me know if this can be make act same for both scenarios.
Thanks
Hello sajitha,
Thank you for your reply!
I have investigated this question further and it appears that the behavior that you face is caused by the differences between the browsers and the way they handle the WebHtmlEditor functionalities.
As explained in the following threads, tags added in the html code are browser specific behavior. IE is using the <p> tag, Mozilla Firefox is using <br> tag and Google chrome is using <div> tag. Edge is also using the <div> tag.
You can have a look at the following links for more detailed information:
https://es.infragistics.com/community/forums/f/ultimate-ui-for-asp-net/76743/using-infragistics-web-html-editor-browser-problem
https://es.infragistics.com/community/forums/f/ultimate-ui-for-asp-net/73628/missing-font-size-attribute-in-webhtmleditor/374739#374739
I hope those resources will be useful for you in understanding the limitations and behaviors caused by the different browsers.
Thank you once more for using Infragistics ASP.NET! If any other issues or questions pop out, do not hesitate to contact us again!
Best regards, Alexander Marinov, Infragistics
Hello Alexander,
Thank you for the quick reply !
The issue is with the html formatting. When we type some text and add line-breaks the text lines contain within <div> tags as shown below,
<div>Line 1 typed from editor</div>
<div>Line 2 from editor</div>
But when we copy text with line breaks from MS Word, the each line contains within <p> tags which are contained inside single div tag as shown below.
<div>
<p>Line 1 copied from MS word</p>
<p>Line 2 Copied from MS word</p>
</div>
What I want is to get one type of html formatting for both scenarios. In this text editor (I guess it is the latest version of WebHtmlEditor) I'm writing this post, clicking on the html button in tool bar I could see the text lines are contained within <p> tags. Maybe the issue with our editor could be making line breaks with <div> tags. Let me know if there a way to handle that.
Thanks!
Thank you for using Infragistics ASP.NET!
I have tried to replicate the scenario that you describe but I was not able to. I guess I am missing some steps from the scenario that you want to achieve.
When I copy a text from MS Word and paste it inside the HTML editor, the only tags that are added to the code are the ones related to the styles and the fonts that are defined in the Word file.
I do not see any differences related to the spacing between the different <p> tags.
Can you please provide me a dummy file or text that you use to reproduce this behavior as well as the concrete steps to reproduce this so I will be able to inspect this case further? Also, can you please tell if you are using ENTER key or a different keyboard combination to create a new paragraph?
Thank you once more for using Infragistics!
I am looking forward to your response!
Alexander Marinov, Infragistics