Adding class to images in rich text How can I add a CSS class to all images inserted into a rich text field ?

ie. so an image inserted has style= "image fit" added to the img selector
I wrote a plugin called Retcon HTML which will solve this nicely using PHP's DOMDocument class.

You'll want to use the attr filter, which is documented here:

{{ entry.richTextField | retconAttr( 'img', { 'class' : 'image fit' }) }}