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

<h2><p>Subheading</p></h2>

Any ideas?

Stig Stig, 6 years ago

Hi,

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.

Stig


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

That worked a treat. Cheers!

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free
1-888-533-8098