1
votes

Want to allow certain tags & properties while pasting from Word/WebPage to TinyMCE4 Editor. I tried to set the configuration as below :

oEvent.getParameters().configuration.valid_elements="em,a[href|target=_blank],strong/b,div[align],br,p[align]";

Now I am able to paste only paragraph,bold & link not text with em tag.

Any idea why its not working ?

I want to allow only certains tags like Paragraph,Stong,StrikeThrough,Bullets.

Any help will be highly appreciated. Thank you.

2
@nina-scholz Can u help? - Pranav Kumar

2 Answers

2
votes

I don't see any issue with using that valid_elements setting. Please see this TinyMCE fiddle:

http://fiddle.tinymce.com/Dmgaab

One editor allows EM and the other does not ... and TinyMCE works as I would expect.

2
votes

Pasting content from word is quite a complicated problem - you'll likely be able to make some functions carry over nicely on your own / with the free version, but tinymce has an extensive paid plugin to handle pastes if that's what you want.

For now, I would try adding span to your list of valid_elements. It would depend on your text source, but I know that tinymce handles italics internally through <span> elements.

valid_elements: "span,em,a[href|target=_blank],strong/b,div[align],br,p[align]"