Prevent WYSIWYG editor adding unwanted span tags

Posted by Community Admin on 04-Aug-2018 09:28

Prevent WYSIWYG editor adding unwanted span tags

All Replies

Posted by Community Admin on 24-Jul-2014 00:00

We have several content editors editing multiple websites and every now and then they will want to set a background colour on a block level element e.g. a paragraph or a header.  If they highlight the entire block in design view and set a background colour, it will only set the colour on the text instead of the whole block.  This is because the editor is wrapping the text in span tags, which is obviously an inline element, and adding the style to that.

As simple as it may be to fix this in HTML view, the content editors can't be expected to learn how to write HTML.  So, is there any way to prevent these span tags from being inserted, as it is immensely annoying?

Cheers.

Posted by Community Admin on 29-Jul-2014 00:00
Hello Neil,

In order to style the entire block I would suggest you to add a custom class on that Content block and than use CSS Widget on that page instead of inline styles.

A short video demonstration is available here.

Regards,
Svetoslav Manchev
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 
Posted by Community Admin on 29-Jul-2014 00:00

Thanks, Svetoslav.  So basically there's no easy, non-technical way for Content Editors to be able to style the entire block, as opposed to just the text in the block?  They would have to understand how to write HTML & CSS or ask us developers to do it for them?

Posted by Community Admin on 29-Jul-2014 00:00
Hello Neil,

This is the default behaviour of that background functionality, as this styles the edited line. Page styling is usually made in the external CSS file.

In order to facilitate the editors work, you could add dedicated styles for Footer, Header, etc, in your main.css file and to ask the Editors just to add a specific class in the Content Block. For example cbFooter, cbHeader, etc. Thus the ContentBlock will be styled "automatically".

Regards,
Svetoslav Manchev
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 
This thread is closed