Forum

Thread tagged as: Question, Error, Field-Types

Additional p tags = invalid markup

Hi there,

I seem to be having an issue with additional and unwanted p tags when using the textile editor.

For example,

<p>I have a paragraph block like this which has a few lines of text to it. Now when i go to view the html i get unwanted and empty p tags that appear in the code like below.</p>

<p></p>

This isn't really a massive problem as it doesn't effect my page layout but when i go and validate it throws out some errors.

Is there anyway to fix this problem at all?

Many thanks,

//C

Cameron Duthie

Cameron Duthie 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

That's right, all of the editors will wrap paragraphs in paragraph elements. The fix would be not to add your own. Or not to use an editor if you don't want formatting.

Thanks for getting back to me, Rachel.

Just so i'm clear, I can't get rid of the empty p tags that are generated below the ones with content in them? Which in turn means the html will be invalid? What if there is no paragraph/content and it still generates the p tags?

I'm not a stickler on valid markup, i'm more being curious than anything else.

Thanks again,

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show us your template?

Hi guys,

Sorry didn't see this response come in.

Sure, template is like so:

<h2><perch:content id="title" type="text" label="Heading" required="true" title="true" /></h2>
<p><perch:content id="text" type="textarea" label="Sub-Text" required="true" textile="true" editor="markitup" /></p>
Drew McLellan

Drew McLellan 2638 points
Perch Support

Change it to:

<h2><perch:content id="title" type="text" label="Heading" required="true" title="true" /></h2>
<perch:content id="text" type="textarea" label="Sub-Text" required="true" textile="true" editor="markitup" />

Ah that'll get you. Thanks, Drew.