Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-11 06:19:50

jamesh
New Member
Registered: 2007-01-11
Posts: 4

Preventing Textile from parsing content inside enclosed tags

I’m trying to make a plugin that modifies the content within the plugin enclosed tags. Unfortunately, it seems that Textile (incorrectly) parses the content before it is sent to the plugin, and in effect, all it does is wrap useless <p></p> tags around each new line. I was wondering if there’s an elegant option or something to prevent this, or is my only option to find and strip those tags from the output? Any help would be appreceated! Thanks!
-James

Offline

#2 2007-01-11 07:00:10

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

Re: Preventing Textile from parsing content inside enclosed tags

That’s not incorrect, that is what it is supposed to do. If you don’t want something parsed by Textile, you need to tell it so:

notextile. Don't textile this line!

Offline

#3 2007-01-11 20:42:21

jamesh
New Member
Registered: 2007-01-11
Posts: 4

Re: Preventing Textile from parsing content inside enclosed tags

I understand, but even when I have table code inside the enclosed tags:
|_. heading1 |_. heading2 |_. heading3 |
|_. row_heading1 | row_data1 | row_data2 |
|_. row_heading2 | row_data1 | row_data2 |
|_. row_heading3 | row_data1 | row_data2 |
Textile would parse it and sent it through $things as:
<p>|_. heading1 |_. heading2 |_. heading3 |</p>
<p>|_. row_heading1 | row_data1 | row_data2 |</p>
<p>|_. row_heading2 | row_data1 | row_data2 |</p>
<p>|_. row_heading3 | row_data1 | row_data2 |<br />

and I’m pretty sure that it should be either parsed as a table, or not parsed at all.

Last edited by jamesh (2007-01-11 20:45:27)

Offline

#4 2007-01-12 03:28:35

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

Re: Preventing Textile from parsing content inside enclosed tags

I’m pretty sure…

No, because articles are parsed by Textile (if you have it turned on) and saved. Tags get parsed later, on-the-fly. If you want stuff from a plugin Textiled, you’ll need to do it from within your plugin.

Last edited by Mary (2007-01-12 03:28:59)

Offline

#5 2007-01-12 04:14:21

jamesh
New Member
Registered: 2007-01-11
Posts: 4

Re: Preventing Textile from parsing content inside enclosed tags

oh, so are tables parsed the same time as the article, or are they parsed on-the-fly later along with the tags?

Offline

#6 2007-01-12 05:00:19

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

Re: Preventing Textile from parsing content inside enclosed tags

Okay, here’s what you might have as an article:

I want this Textiled!

<txp:ext_some_plugin>something or other</txp:ext_some_plugin>

This should be Textiled too.

We don’t want “something or other” to be Textiled, so we change it to this:

I want this Textiled!

 notextile. <txp:ext_some_plugin>something or other</txp:ext_some_plugin>

This should be Textiled too.

Now, the article will get saved as this:

<p>I want this Textiled!</p>

<txp:ext_some_plugin>something or other</txp:ext_some_plugin>

<p>This should be Textiled too.</p>

If we want the output of ext_some_plugin to be Textiled, we will have to do that within the plugin itself, with PHP.

Offline

#7 2007-01-12 22:19:50

jamesh
New Member
Registered: 2007-01-11
Posts: 4

Re: Preventing Textile from parsing content inside enclosed tags

ok I get it now, thanks!

Offline

Board footer

Powered by FluxBB