Note: A newer version is available. Please see the category page for the latest.
Another release of Textile by Dean Allen in his blogging tool TextPattern 4.0 has prompted me to make another release of my pluing based on his work. This release is so much better than the last couple, that I really want to just call it Textile 3. I won’t though, because that would confuse everyone, including me.
At any rate, this release improves block handling, and the ‘notextile’ tag (or double equals) actually works as advertised ( *check out* this "textile":1 code that was _not_ converted! ). Actually, that example brings us to another new feature: You can move the URLs out of your code, (even for images) and refer to them by number.
This release is also a lot better about not screwing up when you insert html into your posts, so this, for instance was done with a pair of <b> tags instead of textile markup. That means that comments don’t get messed up, and there should be any problem, for instance, with the adwords plugin.
There are two versions: Textile 2.6 and Textile 2.6 for beautifiers ... the “for beautifiers” version is what I’m using, it removes Textile’s clean-up of <code> sections, so that I can use GeshiSyntaxColorer …
Just for a cool example of the neat stuff:
The following textile code:
"Check out this page":1 for a nice place to test your Textile skills.
The image below shows a photo from "my flickr page":2
!4!:3
[1]http://textism.com/tools/textile/index.html
[2]http://flickr.com/photos/jaykul/l
[3]http://flickr.com/photos/jaykul/48483236/
[4]http://static.flickr.com/28/48483236_f9d5d11b99_m.jpg
Would reproduce like this:
Check out this page for a nice place to test your Textile skills.
The image below shows a photo from my flickr page

[...] a??a??Textile Plugini??c??a?????c? a??a??c??cs?html? ?c??i??c??a??e??a??e??a??c??cs?BBcodei??2.6e?Sa??a?? by Scott | posted in WordPress Plugins Trackback URL | Comment RSS Feed Tag at del.icio.us | Incoming links [...]
Hello,
I installed your textile 2.6 plugin and like it so far. However, I’ve got a problem with inserting Amazon images. I’ve got a code snipet like this:
[1] http://images.amazon.com/images/P/B000AJJNFE.01._SCMZZZZZZZ_.jpg
[2] http://www.amazon.com/gp/redirect.html..blah..blah..blah..blah
< < snip >>
The result is that the serial number in the first link gets screwed up by textile and turned into an < em > block, and nothing works after that.
In your Flickr example, I would expect the same behavior with the underscores becoming blocks. Got any idea what’s going on?
[...] Update: I’ve just installed Textile 2.6 Beta. The thumbnail no longer works even on the Front Page. Could you suggest any remedy? [...]
Well, the simplest answer to Patrick’s problem is to change the _ to a &#95; which textile will pretty much ignore, but which will render properly in the image.
The complicated answer is that you should go to http://textism.com/tools/textile/ and post a bug to Dean
textile2.6 cannot supoort chinese character
when i put star around chinese word(ex: a????? )
it has no effect
[...] Textile2.6b [1] http://blog.firetree.net/2005/08/25/viewlevel-20/ [2] http://www.huddledmasses.org/2005/10/03/textile-plugin-26-released/ [...]
This plugin produces invalid HTML when used with blockquote, as discussed in this WordPress Support Forum thread. Basically, it should not wrap the tag inside tags, since it ends up overlapping tags if there are multiple paragraphs inside the blockquote. You end up with: !!! It would be great if this could be fixed, since some people on a group blog I manage depend on your plugin!
Ugh. That didn’t come out right:
No This plugin produces invalid HTML when used with blockquote, as discussed inthis WordPress Support Forum thread:
http://wordpress.org/support/topic/19587
Basically, it should not wrap the blockquote tag inside p tags, since it ends up overlapping tags if there are multiple paragraphs inside the blockquote. You end up with: p-blockquote-/p!!! It would be great if this could be fixed, since some people on a group blog I manage depend on your plugin!
If you’re using textile … you should be using “bq. “ at the begginning of the line for blockquotes, not the
blockquotetag …You can use xhtml while using textile, but you need to take into account that you are using textile. Which is to say: if you leave a blank line, textile is going to start a new paragraph for you, unless you’re in a
notextileblock — which does weird things converting everything to code blocks— so to accommodate the fact that your are using textile, you need to put a leading space on the line if you’re starting a block-level xhtml tag after blank lines … or use textile markup.Now, here’s some normal text, and we’ll break for a new paragraph.
Lastly, I’ve got a simple
blockquotetag with a space in front of it …So, I guess I’m not sure what else to say.
as far as i can see, textile2.6beauty breaks the more-teaser-separator by enclosing it in del-tags. probably breaks other html comments, too. in the preq in function span (line 508 in my version), i replaced
($f)
with
(?<!<!-)($f)
Hmm… it should leave html alone, I’ll have to check that one out.
it seems the img tag gets garbled if an alignement = indicator is added. To fix, replace image and fImage functions with the following:
// ——————————————————————————————-
. )? # optional dot-space
(([^\)]+)\))? # optional title
\S+))? # optional href
function image($text)
{
return preg_replace_callback(”/
\! # opening !
#REPLACE THIS
#(\)?
#WITH THIS:
($this->hlgn) # optional alignment atts
($this->c) # optional style,class atts
(?
([^\s(!]+) # presume this is the src
\s? # optional space
(?
\! # closing
(?:
(?=\s|$) # lookahead: space or end of string
/Ux”, array(&$this, “fImage”), $text);
}
// ——————————————————————————————-
function fImage($m)
{
//$this->dump($m);
list(, $algn, $atts, $url) = $m;
$atts = $this->pba($atts);
/*
REPLACE THIS
$atts .= ($algn != ‘’) ? ‘ align=”’ . $this->iAlign($algn) . ‘”’ : ‘’;
WITH THIS:
*/
$atts .= (isset($m1)) ? ‘ align=”’ . $this->iAlign($m1) . ‘”’ : ‘ALIGNNOTFOUND-m0=’.$m1;
$atts .= (isset($m4)) ? ‘ title=”’ . $m4 . ‘”’ : ‘’;
$atts .= (isset($m4)) ? ‘ alt=”’ . $m4 . ‘”’ : ‘ alt=”“’;
$size = @getimagesize($url);
if ($size) $atts .= “ $size3“;
$href = (isset($m5)) ? $this->checkRefs($m5) : ‘’;
$url = $this->checkRefs($url);
$out = array(
($href) ? ‘’ : ‘’,
‘’,
($href) ? ‘’ : ‘’
);
return join(’‘,$out);
}
// ——————————————————————————————-
I hope this helps…
hmmm, looks like the textile plugin garbled the above… the important bits are
#REPLACE THIS
#(\)?
#WITH THIS:
and
/*
REPLACE THIS
$atts .= ($algn != a??a??) ? a?? align=a??a?? . $this->iAlign($algn) . a??a??a?? : a??a??;
WITH THIS:
*/
$atts .= (isset($m[1])) ? ' align="' . $this->iAlign($m[1]) . '"' : '';
[...] The default WordPress installation includes the textile1 plugin, although I recommend installing the latest and greatest textile2 plugin from Jaykul. Textile2 adds lots of new features and allows you to move ugly URLs out of your code, and reference them by number at the end. [...]
[...] The default WordPress installation includes the textile1 plugin, although I recommend installing the latest and greatest textile2 plugin from Jaykul. Textile2 adds a lot of new features and allows you to move ugly URLs out of your code, and reference them by number at the end. [...]
Great plugin. I have been using it for a couple of weeks, and now I can’t live without it. Keep up the good work
[...] Another note: Textile 2.6 is ace. [...]
Hey, when I use the 2.6b.php file the geshi code still gets turned into html. Any advice? Checkout my page to see what I mean.
[...] Transition to Dreamhost. December 29, 2005 Well now all of my current sites are hosted on Dreamhost. The only way to go from here is to get my own box later on down the road. Since I had to upload some files all over again I figured I’d install a new version of the textile 2.6 plugin that allowed support for the Geshi syntax highlighting engine. Let’s do a quick test to see if it worked. def hello puts “hello world” end 3.times do hello Tags [...]
The trick is the priority you assign to the plugins… for instance, if you look at my geshi plugin, you’ll see I have it set to priority 5 (the priority is the last number in the
add_filter('the_content', 'GeshiSyntaxColorer', 5);command at the bottom of the file. And if you check my textile 2.6 plugin, you’ll see that I’ve set it to priority 6. This way seems to work for meI have found that punctuation after an abbreviation (i.e. ... USA, ... rest of my sentence) does not properly convert the textile markup to the abbr html element. Any possibility of fixing this?
never mind…. I guess it does here…
I’m wondering if in a future release you might consider allowing people to turn this off in WordPress on a post-by-post basis. Maybe there could be a custom field or something that allows you to turn off Textile for a specific post.
I’m having trouble with WP2.0 putting double spaces between lines because I’m using the WP2.0 rich text editor. Is there something I should be doing to make it work with WP2.0?
There’s a TextControl plugin that allows switching post-processors per-post … I’m not really planning on supporting that here … Honestly, if you’re using the rich-text editor, I don’t see any reason to use Textile on those posts, and I’m frankly rather frustrated with Matt and the WordPress team for putting the rich text editor in as default even though people are using Textile and Markdown and others — and can’t disable them, because the original WordPress design for these plugins was that they should leave the unprocessed text in the database.
[...] ????N? N??????? N?N?????N? ??N?N?N? “?? N???N?” N?N?N???N?N???N?NZN? ????????????N? “N?????????N??????? ???????? N???N?N???” N? N?N???????NZ Textile Plugin 2.6 ??????N?N? ?????????? ??N???N?N???N?N? N?????N? “?????? N?N??? N?????N???N?”: http://www.textism.com/tools/textile/ [...]
[...] Hasta hace poco estaba utilizando la versión 2.6 de Huddled Masses que implementa las funciones básicas de Textile y algún que otro detalle, pero nada muy avanzado. Sin embargo, es totalemnte funcional y alcanza para un blog normal. [...]
Great plugin, I love it!!!
I’m trying to push it a little further, to use it in titles and meta fields, and here’s where I’m running into a problem:
Is there a way to keep Textile from adding p tags when the content is only one line long? Then I can hard-code a field to be a header, for example, without getting a nested p tag…
Any help you could offer would be appreciated.
Thanks!
-Jeremy
hi there,
is there any chance to use the plugin without harming the function allowed_tags() (used in comments.php to show what html tags are allowed)? whenever i active the textile plugin, it strips away allowed_tags’ output.
and another problem here… the contact form plugin doesnt work, also because of textile. isnt there a notextile-tag like in txp?
Jeremy: That’s a good question. I’m not 100% sure if this will do what you want, but you can try using the ‘lite’ version… You will see on lines 992-995 the function
textilewhich callsTextileThis, and passes only one parameter. Make yourself a copy, call ittextileLiteand change the call toreturn $textile->TextileThis($string, true);… then, in youradd_filtercalls, usetextileLiteinstead oftextile.Arne: Look at the bottom of the file. Line 1008.
Arne: Contact form plugin? It must be (inappropriately) calling a filter for ‘the_content’, ‘the_excerpt’, or ‘comment_text’ ...
thx, commenting out these two lines did it for me
@contact form plugin: well, i dont know anything about wp’s plugin structure, so i dont know in which way i could change the plugin. i only can see that you’re right: it’s calling a filter for “the_content”.
thats the plugin: http://johannesries.de/webwork/contactform/
I installed your plugin on one of my blogs that I share with some family members. After they played with it and decided they would rather just use the rich text editor I uninstalled it (deactivated it and deleted the file) Now I have a problem. The rich text editor is gone, everyone has the option enabled in their profile, it’s also enabled on the Options page, but it will not load on the “Write” pages. I have looked everywhere I can think of even in the DB and cleared my cache folder too. I cannot find whats causing this and the last thing that happened right before it disappeared was the instalation of Textile. Can you help me please
BTW I do have this installed on MY blog and I LOVE it thank you so much. Though I wish I could get mine to work with Geshi like you did, but no biggie I would so rather have Textile than Geshi. Beautiful plugin now if only my family would understand how nice it is
I must sincerely appologize. It was not Textile at all that was messing with TinyMCE it was in fact another plugin. Apparently it took it a little while to kick in though sigh . I am so sorry for my assumption. So the TinyMCE problem is solved
again I’m sorry.
OK I hate being annoying but after very close look at the files (textile2b and geshi) I found out why it wasn’t working.
In your textile2b file it says this around line 812:
/* when using a code beautifire, we don't want this between code tags - JoelNOTICE: this will (still) break if you use both: */
$offtags = ('pre.*|kbd.*|notextile');
and in the geshi file (geshi.php) around line 116:
var $header_type = GESHI_HEADER_PRE; // The type of header to useThat variable needs to be set to GESHI_HEADER_DIV knocks self on head
I can’t believe how long it was staring at me. Geshi was putting pre inside the within code so it was breaking it. So yeah this will fix the problem for those that wanna use Geshi
(BTW you can delete my previous posts I won’t be offended and this little aside too :* )
I love this plugin, but I’ve discovered that this recent version breaks the WordPress ability to use quicktags. Do you have a workaround solution for this?
What on earth do you mean? The quicktags are just little javascripts that insert html tags. There’s nothing in Textile that affects them … in fact, I just tried it and they work fine. Or are you talking about tags in the COMMENTS? They’re disabled by default, but you can see in the comments above how to to enable them again.
I have a contact form plugin that I use. The plugin requires a quicktag () to be inserted into a page in order for the contact form to appear. When I upgraded from Textile1 to Textile2, my quicktags suddenly stopped working. I even turned Textile2 off for a moment to verify that it was, indeed, the thing that was breaking the quicktags. The nearest I can figure is that Textile sees the dashes before and after the quicktag and tries to convert them into formatted text.
Hmm, and I’m noticing that it did it here, as well – removed the
left arrow, exclamation point, dash, dash from the left side and one dash from the right side of the quicktag, which essentially renders it useless. I had the same problem when testing it on the textism site. Dunno if it’s something I’m doing wrong or a bug in the system…. Any help you can provide would be greatly appreciated. You can see what it’s doing to my contact form here.
When doing this:
* "Some text":http://www.example.com
Text on a new line.
* "Some more text":http://www.foo.bar
More text on a new line
the list isn’t closed (the last and are missing). It seems having text on a separate line (using double space after the link) breaks something. Is this something you can fix?
Thanks for a great plugin!
Questions: I started using the latest Textile 2 plugin and then started using FeedBurner so I could publish summaries of the weblog entries on another site. FeedBurner is including the Textile markup in the feed data. I’m guessing this is because WP 2 is responding to feed requests straight from the database so the markup never goes through the textile plugin to get converted on its way to FeedBurner. Is this right? If so, is there a way to fix it?
PA?l: You should probably submit that to the author of textile itself, through his testing and bug-reporting page, here.
Paul: You can parse your feeds (I just don’t think RSS should have HTML embedded in it). Just uncomment the next-to-last line in the plugin:
// add_filter('the_excerpt_rss', 'textile', 6);(that is, delete the slashes at the front so it just looks like:add_filter('the_excerpt_rss', 'textile', 6);).Thanks. I finally figured out that the marked up text that was showing up in the feed was coming from text in the WP2 “excerpt” entry area. I don’t remember putting it there, but there it was anyway. I removed that (which as I understand was overriding what WP2 would normally provide the feed as a post excerpt) and things are back to normal. I agree with you about HTML not being in RSS. I was confused about where the markup was coming from and just figured that WP2 normally stripped the HTML out but didn’t recognize the textile markup as such and left it alone. Anyway, thanks for the quick reply (and the plugin!) — much appreciated.
I installed your plugin – thanks, I love Textile2! I got fed up with the default WordPress editor because it kept messing up my pre tags, and now I’m glad I started looking for a replacement. This is a much more sensible way to create content than hand-coding HTML!
@Jaykul: Thanks, I will.
[...] Sencillo, A?no? Pues si te animas, para WordPress hay varios plugins. Estuve probando unos cuantos y el que mA?s me convenciA? fue el de Huddled Masses que encontrA? a travA?s de yukei.net puesto que otros que habA?a probado me creaban el mismo problema que a A?l: me estropeaba el cA?digo y lo hacA?a ilegible. [...]
I’m having trouble with Textile plugins since I upgraded to WordPress 2.0.3. It seems all the plugins, (including 2.6) seem to start all posts with two beginning paragraph tags, and end with two closing p tags. This is driving me crazy. Am I doing something wrong? Please help. Thanks
Disregard my last post… I got that problem fixed. I REALLY like Textile 2.6, but there’s just one thing that’s not working for me. I give my external links a class, e.g.
(ext)This link
Textile 2.6 seems to recognize classes on spans and block-level elements only. Is there any way I can get it to recognize classes on my links? Thanks for your help.
I also have a problem, which I’ve noticed only since WP 2.0.3 (so it’s easy to blame the upgrade): editing a comment with single quotes in it turns the single quotes into backslash-single-quotes. (That is, \’ )
Submitting the original comment works fine, and they work fine in posts — it’s only when editing a comment that this seems to happen.
Can you advise us whether this is a bug in WP or in Textile 2.6 Beta?
I just installed textile. I guess I just don’t get it. Nothing appears different in my editing box. What am I supposed to see. I have not found any installation instructions. Maybe I am missing something.