voidlabs/mosaico

Suppress Automatic Paragraph Tags

Closed this issue · 6 comments

Is there a way to prevent Mosaico from wrapping a text block in paragraph (<p>) tags? I've always been of the opinion that paragraph tags should not be used in email, since they lead to formatting inconsistencies, but the system seems to wrap any input block text in <p> tags automatically.

bago commented

Mosaico doesn't do this. It is TinyMCE that does it depending on the tag being edited (so depending on the template) and on the configuration of the TinyMCE.

PS: I always used P tags in email without issues.

Thanks, that's why I don't like in-line editors. P tags are known to add extra space in some versions of Outlook (esp. 2010). It's usually not an issue, but I work with some clients that expect pixel perfect layouts everywhere.

bago commented

Are you writing your own template for mosaico using mosaico template language?

BTW you can try altering the way we initialize Tinymce so to change the configuration and pass "forced_root_block : false" option.

try creating a viewModel plugin with this code:

var plugin = function(vm) {
  ko.bindingHandlers.wysiwyg.fullOptions['forced_root_block'] = false;
};

then pass this plugin to your Mosaico initialization method.

Thanks,

Yes, I've developed a template to use as a proof-of-concept for a client. Looks very promising but lots of little things to try and smooth out for integration.

Speaking of the editing plugin, is there anyway to over-ride the default behavior to open the full editor on in-line components? The in-line editor seems too limited, and doesn't provide any way to input coded elements like BR, ®, etc.

bago commented

Using the style of plugin I wrote in the previous comment you can configure TinyMCE to give you full editing with all you want (I don't think it is a good idea to give too much freedom in a paragraph, but this is your choice).

Simply have a look at the tinymce configuration options and try to pass a full-bar configuration.

That's what I thought, and yes, I'm not rushing to do it because it introduces other issues. I don't think it's an issue for the POC. If they decide to move forward, I'll probably suggest replacing TinyMCE with something else.