You are not logged in.
Pages: 1
Howdy—
I’m presenting an excerpt inline and I want to get rid of the paragraph elements (<p> … </p>) generated by Textile— but I want to keep Textile on for the typography and stuff. Is there a way to do this?
I’m excerpting the same articles in another context, and I want those excerpts untouched, so changing the excerpts at the article level isn’t what I need.
Thanks!
Edit: The solution was right under my nose!
Last edited by johnstephens (2009-05-15 16:58:59)
Offline
Hi,
Just put notextile. and then one space before your text and it will remove the <p> tags.
Last edited by immarabi (2009-05-14 01:13:23)
Offline
notextile. seems to eliminate all Textile, the same as choosing “Leave text untouched” under “Excerpt Markup”. As I said before, I want to keep Textile active for its typography and automatic escaping of &.
The other thing is that I don’t want to strip the paragraph element from the excerpt in every context, just in this listform:
<li><strong><txp:title />:</strong> <txp:excerpt /></li>
Elsewhere, I’m using the same excerpt, and I want to keep the <p> tags:
<h3>About this thing: </h3>
<txp:excerpt />
I expect that php-jujitsu may be needed to accomplish this.
Last edited by johnstephens (2009-05-14 01:39:42)
Offline
<txp:pax_grep from="|<p>|,|</p>|" to=","><txp:excerpt /></txp:pax_grep>
You can probably also use rah_replace for this, but I already have pax_grep active on my site.
Offline
Or a slightly simpler pattern:
<txp:pax_grep from="/<\/?p>/" to=""><txp:excerpt /></txp:pax_grep>
Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.
Offline
Dude, why are you making my life more awesome all the live-long day?
Offline
The various native methods are outlined in this TXP Tip.
TXP Tips | @txptips | Me | @jonathanstubbs | Github
TXP Builders – finely-crafted code, design and txp @txpbuilders
Offline
Thanks, Jonathan— I’m a huge fan of TXP Tips, and I’ve seen this article before.
Those methods would be fine if the excerpt was never supposed to have <p> elements, but as I said before, I’m still using the normal <p>-wrapped excerpts for these articles in another context. Doing Textile-fu on the article level doesn’t allow for that differentiation, and requires thinking about it every time I write a new article in that section.
Offline
Haven’t you tried putting a space before the excerpt text? This works on ThresoldState at least…
Offline
Pages: 1