Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-12-12 11:34:05

dpkendal
New Member
Registered: 2010-12-12
Posts: 3

[textile] Difference between Textiles Lite, Restricted, and Restricted Lite?

I’m looking into the differences between the variants of Textile offered. I put together a small test script to show me the differences.

<?php

require 'textile.php';

$input = <<<EOF

This is some *example* _Textile_ input. "These are some" 'quotes.' "And this is a link":http://google.com/

Textile rules! <b>These are some</b> <i>ordinary</i> <div>tags.</div>

EOF;

print "Input:\n".$input;

$std = new Textile;
print "Standard Textile:\n".$std->TextileThis($input, false)."\n";

$stdlite = new Textile;
print "Standard, Lite:\n".$stdlite->TextileThis($input, true)."\n";

$res = new Textile;
print "Restricted Textile:\n".$res->TextileRestricted($input, false)."\n";

$reslite = new Textile;
print "Restricted, Lite:\n".$reslite->TextileRestricted($input, true)."\n";

?>

(I know it’s not necessary to instantiate Textile each time, but I wanted to be sure that none of the processors were interfering with each other.) When I run it, I get this output:

Input:

This is some *example* _Textile_ input. "These are some" 'quotes.' "And this is a link":http://google.com/

Textile rules! <b>These are some</b> <i>ordinary</i> <div>tags.</div>
Standard Textile:
	<p>This is some <strong>example</strong> <em>Textile</em> input. “These are some” ‘quotes.’ <a href="http://google.com/">And this is a link</a></p>

	<p>Textile rules! <b>These are some</b> <i>ordinary</i> <div>tags.</div></p>
Standard, Lite:
This is some *example* _Textile_ input. "These are some" 'quotes.' "And this is a link":http://google.com/

Textile rules! <b>These are some</b> <i>ordinary</i> <div>tags.</div>

Restricted Textile:
	<p>This is some <strong>example</strong> <em>Textile</em> input. “These are some” ‘quotes.’ <a href="http://google.com/" rel="nofollow">And this is a link</a></p>

	<p>Textile rules! &lt;b&gt;These are some&lt;/b&gt; &lt;i&gt;ordinary&lt;/i&gt; &lt;div&gt;tags.&lt;/div&gt;</p>
Restricted, Lite:
	<p>This is some <strong>example</strong> <em>Textile</em> input. “These are some” ‘quotes.’ <a href="http://google.com/" rel="nofollow">And this is a link</a></p>

	<p>Textile rules! &lt;b&gt;These are some&lt;/b&gt; &lt;i&gt;ordinary&lt;/i&gt; &lt;div&gt;tags.&lt;/div&gt;</p>

So, what exactly are the differences between Restricted Textile and Restricted Lite Textile? What’s the difference between Lite Textile and not putting the text through any handlers at all? Which handler is best for which situation?

Offline

#2 2010-12-12 14:35:45

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Difference between Textiles Lite, Restricted, and Restricted Lite?

If Restricted is used, no images will be allowed (by default), links get rel="nofollow" (by default) and all raw html will be escaped. If the extra Lite mode is set on, no footnotes will be generated and blockelemets are not allowed.

And the normal TextileThis has no above restrictions. Basically Restricted and Restricted+Lite are preferred when Textile is used for public posting (comments/wikis etc), where the normal TextileThis allows full control.

Offline

#3 2010-12-12 20:48:46

dpkendal
New Member
Registered: 2010-12-12
Posts: 3

Re: [textile] Difference between Textiles Lite, Restricted, and Restricted Lite?

So what does TextileThis with Lite do? Is it ever used?

Offline

#4 2010-12-13 10:01:59

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Difference between Textiles Lite, Restricted, and Restricted Lite?

dpkendal wrote:

So what does TextileThis with Lite do? Is it ever used?

If the extra Lite mode is set on, no footnotes will be generated and blockelemets are not allowed.

Offline

#5 2010-12-20 00:00:03

dpkendal
New Member
Registered: 2010-12-12
Posts: 3

Re: [textile] Difference between Textiles Lite, Restricted, and Restricted Lite?

Ah, apologies. I misunderstood your post. Thanks for the info!

Offline

Board footer

Powered by FluxBB