Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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
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
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
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
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
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)
Offline
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
Pages: 1