This is a migrated thread and some comments may be shown as answers.

Paste from work changes the headers to paragraph

5 Answers 109 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ladan
Top achievements
Rank 1
Ladan asked on 06 Sep 2012, 02:10 PM
Paste from word in rich text editor is adding p tags to the headers and therefore the proper style is not appearing in front end, or someone has to edit styles on the headers after pasting to Roch text editor. Any idea how I can fix this?

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 10 Sep 2012, 12:51 PM
Hello,

RadEditor just strips the MS Word specific tags, styles and attributes. It does not strip the valid HTML and XHTML tags and attributes.

That is why my suggestion is to paste the MS Word content in RadEditor or in an editable iframe/div and see how it is pasted with the MS Word formatting and whether the p tags exist in the headers.

All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ladan
Top achievements
Rank 1
answered on 10 Sep 2012, 05:24 PM
Thank you for replying to my message. Here is what I see when I paste the content from word



As you can see there is no P tag in the content but if I paste to the Rich text editor in sitecore it adds the P tags to the headlines
0
Rumen
Telerik team
answered on 11 Sep 2012, 02:18 PM
Hi,

You should paste the Word content directly in the red bordered iframe content area and to preview it press the Show Iframe HTML button.

The first textbox is to set HTML/plain text content in the iframe and is not related to the paste scenario.

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ladan
Top achievements
Rank 1
answered on 14 Sep 2012, 06:29 PM
I can see that the P tags are inserted when I paste from word.



any suggestion how I can get rid of the p tags? there are suppose to be H2 tags ....
0
Rumen
Telerik team
answered on 19 Sep 2012, 12:26 PM
Hello,

You can attach to the OnClientPasteHtml event of RadEditor, which will give you access to the pasted content before it is inserted in the content area. In this event you can check for the executed command (args.get_commandName()) and modify the content provided by the args.get_value() method. After that set the modified content in the editor via the args.set_value() method.

Greetings,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Ladan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Ladan
Top achievements
Rank 1
Share this question
or