CM replacing h2 in template with p

This is annoying.

In the template I'm working on I've got a line for a subheading to be entered by the user - nothing out of the ordinary, just

<h2><$description default='Subheading'$</h2>

But when in the CM interface a <p> is getting inserted by CM inside the <h2>. So at the preview stage it then looks like


Any ideas?

Stig Stig, 6 years ago


Sorry for the trouble. The <$description$> tag inserts a (multi line) area that can be edited with a WYSIWYG editor. If the outer element(s) in this area isn't a block level element, the WYSIWYG editor will add a <p> element for you.

I'm afraid we can't disable this behavior, but you can work with it to get the results you want. For example, you could wrap a <div class="subheading"> around the <$description$> tag, and use .subheading p { ... } to style the subheading appropriately.


The Campaign Monitor Blog – HTML email smarts to go with your good looks.
shg, 6 years ago

That worked a treat. Cheers!

See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free