voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.7k stars 501 forks source link

Empty tinymce titles/buttons are not really emptied #428

Closed bago closed 6 years ago

bago commented 6 years ago

It currently fallback to a "bogus" br that is needed for most tinymce contenteditable workarounds. Given it is not empty, our :empty CSS to make it selectable, won't work, too.

We should investigate about using getContent() instead of getContent({ format: 'raw' }). We used raw because of symmetry with the beforeSetContent handler, but maybe we should better use non-raw output to get tinymce internals "cleaned up".

We could also implement a way to add an "empty" class to the editable when the content is "almost empty" (e.g: only tags, only spaces) so that we can also add more CSS for that special use case.

bago commented 6 years ago

Added an option to the wysiwyg binding: by default we keep the old behaviour, but this can be overridden to use the new behaviour.