I am using TinyMCE V5 to enable my users to write email templates.
Since we're dealing with email templates, there's the Outlook problem. Outlook does not support a wide variety of styles and elements.
Here I am focused on aligning images in a way that Outlook can understand.
TinyMCE default implementation of alignment for images is:
- for right alignment > adds
style="float:right;"
to theimg
tag - for center alignment > adds
style="display:block;margin-left:auto;margin-right:auto;"
to theimg
tag
Outlook doesn't support float nor auto margins.
Is there a way I can override how TinyMCE does alignment for images?
If so, I'd add text-align:right
to the p
tag, and make img
have display:block
.
I am aware that this would make it impossible to have two images aligned to different sides in the same paragraph, and I'm OK with that.