We've unchecked the clean HTML feature on a few rich text fields but our attempts to add some html (span tags) keep getting cleaned out. Is there another setting we should be looking for?
I came upon this issue when wrapping copy with a span tag in order to style it differently. The span tag was removed when I saved the entry.
By design, Redactor removes span tags that don't have attributes. The fix is to edit the Redactor config file and add the removeWithoutAttr config as an empty array.
This prevents tags without attributes from being removed by Redactor.
Best I can figure it's either:
- A Redactor bug
- A known behavior and Redactor just really doesn't like
Even if you explicitly set Redactor's allowedTags config setting to include span, they will strip it out simply swapping between source and rendered view, whereas any other tag I set in that list will be allowed as expected.