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

Auto clean pasted content, ex only link, bold and BR allowed.

2 Answers 26 Views
Editor
This is a migrated thread and some comments may be shown as answers.
oysteintvedten
Top achievements
Rank 1
oysteintvedten asked on 31 May 2010, 02:45 PM
Hi

Our customers paste all kind of html text into our CSM system from word (or other).
The font type and font size is copied to the web from word. The site should use fonts defined in css and not in word.
We use a lot of time to tell our customers to copy via notepad or paste as plain text.

My own suggestion is to create an automatic routine that runs on paste,
that removes every html tag, except as lite as breaks, links and bold text.

Do you have a recommended solution here?

Thanks

/Oys

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 31 May 2010, 02:58 PM
Hi,

You can strip the desired tags and attribute from the pasted content by attaching to the OnClientPasteHtml event of RadEditor. You should write your own filters based on regular expressions or DOM API that will strip the unwanted tags and attributes.

The code provided in this forum thread could be helpful: Any comments/suggestions for this HTML tag-stripping filter?.

Greetings,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
oysteintvedten
Top achievements
Rank 1
answered on 31 May 2010, 03:04 PM
Thanks, I will look at it.

/Oys
Tags
Editor
Asked by
oysteintvedten
Top achievements
Rank 1
Answers by
Rumen
Telerik team
oysteintvedten
Top achievements
Rank 1
Share this question
or