Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-28 07:21:53

da_buddha
Member
From: Pittsburgh, PA
Registered: 2005-04-24
Posts: 14
Website

how do I get rid of the <p>?

In Textile, for articles… when they are output (either as a Single or in an article list on the front), there is always a < p> and < /p> (without spaces) set of wraptags that goes completely around the ENTIRE body. I tried searching through the PHP Textile code but it is way too long to find it myself…

Where is the wraptag inclusion to cover the entire body? I want to take that out… I have a complicated set of <divs> and I get W3C validation warnings when I have the < p> wrapping and I don’t need it. Thanks for your help!

Last edited by da_buddha (2005-10-28 07:41:48)

Offline

#2 2005-10-28 07:37:00

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: how do I get rid of the <p>?

That’s weird, it shouldn’t be doing that. Do you have an example somewhere we can see?

Offline

#3 2005-10-28 07:41:05

da_buddha
Member
From: Pittsburgh, PA
Registered: 2005-04-24
Posts: 14
Website

Re: how do I get rid of the <p>?

> mary wrote:

> That’s weird, it shouldn’t be doing that. Do you have an example somewhere we can see?

EDIT: Ohhh, I forgot the forum formatted my < p> tags, so I added spaces in them above so they don’t get formatted… but you get the idea! heh… sorry ;)

Eh? It’s the Textile addition… Go to an article under content, and in the text area, there is that side tab (once you have text) called “HTML”. Click that, and it’ll show you what it’ll look like in HTML form. And you’ll see a < p> at the beginning and a < /p> at the very end.

There are times where if you start an article with a < (as in < b> or < i> or < div> without spaces) it averts the < p>. I guess there is a check somewhere in the PHP that looks for “if there isn’t a < (as in already a < p> there) in the beginning, add < p>” to make it a “proper” article… Trying to find where that is and take it out! :D

Last edited by da_buddha (2005-10-28 07:42:42)

Offline

#4 2005-10-28 07:49:50

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: how do I get rid of the <p>?

> “And you’ll see a <p> at the beginning and a </p> at the very end.”

I’m confused now, are you asking how to turn off Textile, or is it behaving incorrectly? In other words, are you seeing this:

bc..<p>My paragraph.</p>

or this:

bc..<p>
<p>My paragraph.</p>
</p>

? If its the first, just turn off Textile. There’s info about it in the FAQ, probably in the manual, and in the little help popups (“?”) near the Textile dropdown select menus.

Offline

#5 2005-10-28 08:20:07

da_buddha
Member
From: Pittsburgh, PA
Registered: 2005-04-24
Posts: 14
Website

Re: how do I get rid of the <p>?

What you said is correct… I see:
< p>My paragraph.< /p>

And I don’t want the < p>‘s there at all but I DO want Textile on… I can just go through and “hack” (vicious term) up the PHP code and remove the code that looks for whether there is a < in the start and if there isn’t, adds < p>

Offline

#6 2005-10-28 17:04:58

graeme
Plugin Author
Registered: 2004-06-21
Posts: 337
Website

Re: how do I get rid of the <p>?

da_buddha,

You need to add a single space at the beginning of the paragraph to remove <p> tags and keep all the other textile formatting.

Offline

#7 2005-10-28 20:39:58

da_buddha
Member
From: Pittsburgh, PA
Registered: 2005-04-24
Posts: 14
Website

Re: how do I get rid of the <p>?

> graeme wrote:

> da_buddha,

> You need to add a single space at the beginning of the paragraph to remove <p> tags and keep all the other textile formatting.

doesn’t do anything… just… puts a space and there still is a <p>. I need a complete PHP hack fix…

Last edited by da_buddha (2005-10-28 21:49:51)

Offline

#8 2005-10-29 00:48:40

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: how do I get rid of the <p>?

Can you be specific please? Show us a short example article as you entered it in the Body field, and the resulting output. The FAQ explains how to post code on the forum.


Alex

Offline

#9 2005-10-29 06:49:02

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: how do I get rid of the <p>?

Won’t be this the tipical case where you have surrounded the <code><txp:body /></code> with a <code><p></p></code>.

da_buddha, in “Presentation -> Forms” at look the article form you are using to format your articles.
Is there something like this?

<code><p><txp:body /></p></code>

If answer is yes, remove the “p” tags.

Edit:
<blockquote>Go to an article under content, and in the text area, there is that side tab (once you have text) called “HTML”. Click that, and it’ll show you what it’ll look like in HTML form. And you’ll see a < p> at the beginning and a < /p> at the very end.</blockquote>

Ops! Now that i read that, the problem doesnt seem to be in the article form…

Last edited by maniqui (2005-10-29 06:53:34)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#10 2005-10-30 06:52:18

da_buddha
Member
From: Pittsburgh, PA
Registered: 2005-04-24
Posts: 14
Website

Re: how do I get rid of the <p>?

Ahhh I found it!! :D

in file: lib/classTextile.php
line 456
the line:
$line = (!$php and !$txp) ? preg_replace('/^(?!\t|<\/?\w+|$)(.*)/', "\t<p>$1</p>", $line) : $line;

changes to:
$line = (!$php and !$txp) ? preg_replace('/^(?!\t|<\/?\w+|$)(.*)/', "$1", $line) : $line;

this tell it (later in the code) when it looks to output it says "output $1" instead of just "output <p>$1</p>"

Last edited by da_buddha (2005-10-30 06:53:44)

Offline

#11 2005-10-30 12:13:33

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: how do I get rid of the <p>?

That line shouldn’t be putting p tags around the entire body; it should be putting them around each individual paragraph. If you were getting p tags around the entire body, something else was probably causing it.


Alex

Offline

Board footer

Powered by FluxBB