Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-12-13 18:36:17

NickT
Member
From: England, UK
Registered: 2006-12-12
Posts: 13

Better <notextile> support

Hi All,

I’ve been developing a TXP plugin recently, and noticed that although I wrapped my content in <notextile> tags, TXP would still break things if I had a blank line. The plugin I am developing is syntax highlighting (GeSHi), so hopefully you’ll get the basic idea:

(Apologies for lack of tidyness – I can’t figure out how to do multi-line code blocks)

<txp:my_plugin><notextile>
function something () {
// do this

/* and that*/
}
</notextile></txp:my_plugin>

Now, although <notextile> is specified, TXP still picks up on the blank line and inserts a load of formatting such as <br /> and so on.

Thanks to Mary’s excellent <upm_textile> plugin, I’m able to get around this, but I would rather not release a plugin if it’s not able to do its job without the help of another plugin.

Now, I’m fairly new to TXP (although I’ve used it on and off before), so forgive me if there is something I can use inside my plugin function, but searching through these forums seems to bring up a few threads where people have had similar issues.

Edit: Sorry, this should be in in How do I? rather than Feature Ideas

Thanks in advance,
Nick

Last edited by NickT (2006-12-13 18:37:58)

Offline

#2 2006-12-13 18:53:58

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Better <notextile> support

Does notextile. have the same effect? Or what if you used bc.

Textile 2.0 reference this is the version included in 4.0.4

Last edited by hakjoon (2006-12-13 18:56:14)


Shoving is the answer – pusher robot

Offline

#3 2006-12-13 18:58:51

NickT
Member
From: England, UK
Registered: 2006-12-12
Posts: 13

Re: Better <notextile> support

Hi Patrick,

Thank you for your quick response :)

notextile. shows the same issue, and bc. doesn’t work at all (removes the syntax highlighting).

What I meant in my original post was is there any TXP functions that I can use inside my plugin’s code, rather than outside?

Thanks again,
Nick

Offline

#4 2006-12-13 19:24:21

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Better <notextile> support

NickT wrote:
What I meant in my original post was is there any TXP functions that I can use inside my plugin’s code, rather than outside?

I don’t think there is, because Textile gets performed on article save. By the time plugins get called textilization (how’s that for a word) has already happened. There are some documented issues with <notextile> in the known bugs forum so hopefully it’s something that will get corrected.

Last edited by hakjoon (2006-12-13 19:27:43)


Shoving is the answer – pusher robot

Offline

#5 2006-12-13 19:26:51

NickT
Member
From: England, UK
Registered: 2006-12-12
Posts: 13

Re: Better <notextile> support

I see – thank you for your help and patience; it is very much appreciated!

Offline

#6 2006-12-13 19:27:55

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Better <notextile> support

Oh what about notextile.. (2 periods) that seems to work properly for multi blocks. You can restart textile parsing by using a p. works like bq.. Not a plugin function but maybe it will let it work.


Shoving is the answer – pusher robot

Offline

#7 2006-12-13 19:32:09

NickT
Member
From: England, UK
Registered: 2006-12-12
Posts: 13

Re: Better <notextile> support

That seems to strip the blank line from the plugin content, and doesn’t appear to have restarted textile after the plugin output.

Offline

#8 2006-12-13 21:32:23

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Better <notextile> support

oh well. You might have to wrap it in <pre> or <code> to keep that line I guess. Doesn’t genshi work if the sample is wrapped in <code>tags? Sorry I’m out of ideas.

Oh and BTW ske_genshi. Maybe looking at that implementation might help as well.


Shoving is the answer – pusher robot

Offline

#9 2006-12-13 21:41:23

NickT
Member
From: England, UK
Registered: 2006-12-12
Posts: 13

Re: Better <notextile> support

The output is wrapped in <pre> tags – GeSHi does this itself.

I have tried taking a look at that plugin, but the URL doesn’t seem to be correct anymore :(

No worries anyway, thanks again Patrick :)

Offline

#10 2006-12-14 02:07:53

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

Re: Better <notextile> support

You will have to do: notextile. <txp:my_plugin />

Offline

Board footer

Powered by FluxBB