19 Apr
Well, the code that I have for Textile 2.0 is actually marked “beta” but it works great. In fact, it’s what I use to do all the formatting of posts for my site (including the comments – hint, hint [
]). At any rate, it is what Dean Allen calls “a Humane Text Generator.” It’s purpose is to allow you to do some formatting of your posts without having to learn HTML at all.
That is, you put asterisks (*) on either side of a word for strong text, and underscores (_) for emphasis, and so on. You can play with how it works on Dean’s test site for textile and if you want the WordPress textile plugin, you can get it here... I also made a plugin of the older version, at Matt’s request, so here is the textile 1.o plugin
As a side note… this plugin completely disables WordPress’s built in “texturize” plugin. Not doing so results in a mishmash of ampersands and garbage that practically always results in random links and completely illegible posts.
Edit 3-May-2005] I just noticed I’m using a slightly updated version that I haven’t linked before (all I did was make some changes that make Beautifier work a little better), but just to be sure, here are my 2.5 changes
Edit 3-Oct-2005] Another release by Dean Allen in his blogging tool TextPattern 4.0 has prompted me to make another release too. Supposedly minor changes, but … it should improve block handling and the ‘notextile’ tag (or double equals) works, as evidenced by *this text* not being _marked up_. 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
71 Responses for "WordPress Plugin - Textile 2.0"
hi,
can’t seem to get it to work… i put it in the my-hacks.php file and get back this “Fatal error: Call to undefined function: remove_filter() in /home/bright/public_html/bwp/my-hacks.php on line 389” when going back to any page in the admin… so for now i’ve deleted the entry in the my-hacks.. thanks brian
It’s not a “hack” it’s a plugin. It’s designed to work with WordPress 1.2+
I’ve activated the textile 2.0 plugin, and it works, but not for feeds (atom/rss). How do i enable it for feeds?
Ah, yes. If you want to filter your RSS (Really Simple Syndication) feeds you need to add a filter for them … from what I can tell in the beta I’m running, it should work automatically if you use “Full Content” in your RSS feeds, but not at all with excerpts because there’s no hook in the rss excerpt code that I have. I’ll upgrade to the latest 1.2 version and let you know.
So … I upgraded to the latest nightly (May 24 – post Mingus) and sure enough, there’s a hook for the RSS (Really Simple Syndication) feeds. You could just add a line to the bottom of the textile2 plugin (you can edit it in the “Templates” section of your WP control panel):
add_filter(‘the_excerpt_rss’, ‘textile’, 6);
However, I wouldn’t do that, myself. The excerpt is put into the rss “description” tag, which really ought not to have HTML in it, IMHO [
]
So, I have a ton of HTML posts that I just imported from MT. If I turn the WP Textile plugin on (for using in new posts), it munges the HTML. Is there a way to tell the plugin to exit early if it encounters HTML — or skip over any pre-existing HTML tags?
Hrm… Well … the majority of that code is not mine, obviously, it’s from Dean Allen … the only thing I can think of would be to wrap your existing code in <notextile> tags, which is supposed to make it not process it.
The problem is that Textile allows HTML code through, but it still wraps everything in <p> tags wherever there’s a blank line. [
] I’m not sure if there’s anything you can do about it … I suppose it’s possible, if the <notextile> solution works, that a script could be written to put that on all your existing posts…
Well, here’s one for you: I’m using your textile plugin for my site. I have a post, containing this:
1)
<> !*’‘#
^”`$$-
!*=@$_
%*<> ~#4
&[]../
|{,,SYSTEM HALTED
2)
^<
<.*}”_# |
-@$&/_%
!( @|=>
;`+$?^?
,#”~|)^G
What I get when I attempt to save this, whether I enclose it in tags or no, is
Fatal error: Call to undefined function: detextile() in /homepages/33/d89062730/htdocs/wp-content/plugins/textile2.php on line 476
Any ideas?
I’ve big pb with you plug-in … when turned on, all character (French ISO-8859-1) are not showed ….
An alternantive ??
Well, I’m trying the version that’s currently in TextPattern (the blogging software by Dean Allen) ... it doesn’t have the detextile, so you shouldn’t have that problem Chris, maybe you could try upgrading? What version does your plugins page say? (My current copy is 2.4 Beta).
As far as French … I don’t really know what it’s doing to your characters … do you have a sample? Can you try putting a few of them in here?
I don’t want to get into a whole debate about how to specify language tags, but Dean Allen is French …so it seems like it should work [
]
[...] [...]
Like Chris, I’m having the “Fatal error: Call to undefined function: detextile()” problem as well. However, it’s only showing up on my localhost installation (on Windows), not on my web install. Perhaps it’s a difference between the PHP (PHP: Hypertext Preprocessor) installs on the two machines, forcing different paths in the code?
Never mind. I had imported my MovableType blog, where I used Brad Choate’s MT-Textile 2.0 and MT-CodeBeautifier plug-ins in some entries. WP isn’t wild about some MT-Textile stuff, and it really doesn’t like MT-CodeBeautifier. Once I stripped those out, things perked up nicely. I haven’t debugged it, but I suspect the culprit was lines like “@[PHP (PHP: Hypertext Preprocessor)]echo(‘foo’); @”.
I just moved over from MT to WordPress, and was really glad when I noticed that there is a Textile2 plug-in for WordPress. I used Brad Choate’s Textile2 for MT and was very pleased with it. Thank you for writing this plug-in!
After spending a couple of nights getting the blog to work correctly I noticed that there are some parts of Textile2 that are not implemented in your plug-in. The one which I have been using the most is block alignment and indent (characters < , >, =, <>, ) and (). Do you intend to support them? In my opinion they are pretty useful.
Have you found a solution for french characters not showing ? I try textpattern : no textile problem with exactly the same code as this plugin. So the problem seems to be in the way the filter is called ???
Thanks …
lugins — ubahmapk @ 4:17 pm Well, I’m obviously having some issues with Textile again. (Strange—links work but images and block quotes don [...]
ore-40"> Weitere Infos A?ber das Wordpress-Plugin gibts IM (Instant Message) Wordpress Wiki und auf der Homepage des Plugin-Autors. Ich habe das Plugin mal getestet und muss sagen [...]
Danke!
). Lovely. Why was that feature removed? So what Textile plugin are you using? Textile 1, Textile 2, or Textile 2 (Improved)? Or maybe Markdown? Feel free to share y [...]
Textile bug: swallows non-ascii characters
The problem
It seems like Textile doesn’t play well with non-English languages. As I haven’t seen any solutions anywhere, I’m posting this trackback. Maybe it’s fixed, I don’t know, but here we go anyway.
(“I also posted this on the WP S…
WordPress – related blog WordPress RSS (Really Simple Syndication) Agregator I’ve got it installed in wp-content. WordPress Textile Plugin Page WordPress Plug-ins DB [...]
I have problems getting these Norwegian charaters to work properly:
Test lower case: A? (ae) A? (oe) A? (aa)
Upper case: A? (AE) A? (OE) A? (AA)
When running Textile2 my “special” characters don’t show up in the post, but tthe heading are still ok.
ness There are some great input plugins for Wordpress out there, like textile1, textile2 and markdown. However, I think they all miss an obvious but importa [...]
Press og hapte da selvfolgelig at WordPress gjorde jobben sin. Men. Etter som jeg bruker Textile 2 for formatering av artiklene skriver jeg ikke linkene pa «va [...]
quite nicely. Here is a short list of the things I fixed this morning: Upgraded to the latest Textile 2 plugin Upgraded to the latest Spaminator plugin Install [...]
What about the norwegian characters A?A?A? and A?A?A??
It seems like the plugin ignores words with this characters.
I’ve discovered a bit of a bug in Textile (this is on the WP plugin for 1, but assume it’s there for 2 as well). If a commenter leaves three exclamation marks (or more) in a row, it creates a bunch of dead img links thus (spaced to appear here):
The result is a bunch of dead links throughout comments. Seems likely that commenters would add such things (Cool!!!) etc., so the choice of ! as a bounding tag for imageurl was not a good one.
I tried hacking the code, but I’m not clear which other characters are allowable and not reserved in PHP (PHP: Hypertext Preprocessor), etc., for other things.
Any ideas how to fix this?
If nothing else, could you tell me which lines to comment out in textile1.php to lose the
conversion, which I don’t use otherwise? Thanks…
First of all, I love the plugin. Thanks!
Second, I found a bug… successive posts on the front page of a Wordpress that use the footnote1 markup all use the same tag on the anchor (#fn1). This means that earlier posts (further down the page) have footnotes that point to the first #fn1 anchor. Maybe the anchor should reflect the slug for the post or a GUID or something?
1 I really like footnotes.
P.S. “SEO Expert” (#comment-858 on this page) is obviously just a Google bomber, trying to get that term linked to his web site.
You certainly deserve thanks for making and hosting the Textile plug-in, but his one word comment is contentless; all he wants is the link back to his site. You should delete his comment. Bastard comment spammers!
Everyone with foreign letter problems: your letters seem to appear fine here?
Gary: I’m not clear about the !!!!! thing … it’s not happening on my blog, so I don’t know what to tell you. However: To turn off images: convert the function textile around line 947 of the 2.4 plugin to this:
$textile = new Textile;
return $textile->TextileThis($string, $noimage=true);
}
David: Well, I don’t quite see your problem2 either. You just put the square brackets around the number, and it makes a footnote to that number. Seems to be working here on my page?
I just noticed I’m using a slightly different version (all I did was make some changes that make Beautifier work a little better), but just to be sure, I’m linking it in the main article above.
Oh, and one last thing … Crazy Bob (aka SEO Expert) isn’t an SEO Expert or a Google bomber. He’s actually something of a Google spoiler … as you’ll see if you click through his link.![[laughing]](http://HuddledMasses.org/wordpress/wp-content/plugins/smilingmasses/laughing.gif)
2 In other words, not a problem for me.
There’s a small bug in the
tag handling regular expression that causes it to fail to parse markup like !{class:value} /image/url!
If you change the expression to include \s* between the “optional dot-space” expression and the “presume this is the src” expression, these are parsed correctly.
I think the use of all the non-hungry expressions is the cause. Having at least one “semi-hungry” expression helps anchor the others.
In the previous comment, “tag handling” should be “image handling” and “s*” should be backslash-ess-star.
OH MY GOD!
I spent like 30 mins trying to figure out why the plugins wouldn’t work (since I couldn’t find them at the textile SITE! I found them here… only to discover that the files are all formatted in HTML!!!! WHYYYYYYYY
So I copied the code from the rendered html into a text file and now it should work fine

Just thought you should either provide a raw text version, and/or point out the fact that these files are not just plain ol’ PHP (PHP: Hypertext Preprocessor) files… (i just “save file to disk“ed them…)
Thanks for providing the files though!
Cheers
Oh! And the 1.0 Version link above just goes to the 2.5 file
[...] te or understand the Plugin Repository page, please let me know. [back]Which I found via Huddled Masses. [back]Although I couldn’t for the life of me get the Alex K [...]
I tried Textile plugin 2.5 beta, and it works quite well. But I see this plugin alters HTML tags severly:
For example, a href=“test__program_screenshots.jpg” is translated a href=”_programscreenshots.jpg (‘em’ tags in attributes!
)
I hope this issue is fixed soon.
Thanks.
Hi
First of all: Thanks for taking the effort of making this plugin 
I just played around with it a little bit (after I’ve become used to Textile thanks to instiki) and found a small problem with it. In the block function when you try to determine if the current line starts a pre-block or not, you only accept pres without arguments.
-437,7 +437,7array_push($text, “ “);
foreach($text as $line) { – if (preg_match(’//i’, $line)) {
+ if (preg_match(’//i’, $line)) {
$pre = true;
}
Sorry, another thing: Could it be that your span, code etc. functions basically ignore the notextile blocks? I mean, if you do something like
*hello*
“hello” is still strong
Whoops, better comment on the updated entrya??
Thanks for writing this plugin. I’m writing to note an issue i’m seeing with text I marked up with Textile for use in my MT blog which I’m importing into Wordpress.
It seems that the Textile2.5 plugin fails to create a block quote when the first thing following it is a textile encoded link:
bq. "Wordpress":http://www.wordpress.org
Also appearantly the MT plugin has some innovations like extended blocks, that I found really handy. I could enter =bq..= and it would blockquote everything until the next block idenfitier (usually a p.). It would be very cool to be able to use this in Wordpress too.
Hmm, I’m not so sure I’m right about what’s causing the blockquote to fail.
[...] This is frustrating. [...]
Well, the plugin is great, but using “
“ to designate deleted text (the strike tag i.e.) messed up my import from blogger. Every post that had a minus in it was suddenly striked through, you can imagine my surprise when I first noticed it. ;)Anyway, is it possible to turn that one feature off (possibly “+”, too, because I might want to use a + in my texts sooner or later…
Which leads me to the question: If I use Textile, I can’t post mathematical content, right?
[...] FA?r das Anlegen und Editieren eines Beitrags steht in WP ein rudimA?nterer Editor zur VerfA?gung, auf Wunsch lassen sich aber JavaScript basierende WYSIWYG-Editoren in das System einbinden. Der mitgelieferte Editor, generiert XHTML-konformen Code und lA?sst sich auf einfache Art und Weise bedienen. Es gibt wie ich feststellen konnte auch ein Plugin fA?r Textile. Textile zeichnet sich durch eine einpregsame Syntax aus und ist ideal fA?r alle die sich nicht mit HTML herumschlagen wollen, aber dennoch Wert auf sauberen Code legen. Bloggen per Mail gefA?llig? Was in Joomla! bisher nur in Kombination mit der Erweiterung MamboByMail mA?glich ist – nA?mlich das direkte VerA?ffentlichen von BeitrA?gen via Mail, erledigt WordPress souverA?n. Man sendet eine Mail an ein am Besten geheim gehaltenes Postfach, welches dann WP in regelmA?AYigen AbstA?nden auf neue Nachrichten A?berprA?ft und gegebenfalls die Mails abholt. WP schreibt die auf diesem Wege A?bermittelten Daten in die Datenbank und lA?scht IM (Instant Message) AnschluAY daran die zuvor eingetroffene Mail vom Server. [...]
I’ve finally gotten around to adding a “download” link to my source script. All of my plugins should be simple and easy to download now, just click through to the source and hit the download link.
Hopefully that will solve all the download problems people have had.
I’d like to congratulate you on a fantastic plugin for WordPress. I’m still very new to WP but this plugin makes it a lot easier to use.
However, I’m having some extreme difficulty with escaping. I use the AdSense Deluxe plugin, and this uses tags in the form of an HTML comment (< !–- comment -->) to insert a block of code (usually adsense code). For some reason though, no matter how I try to escape this small block, it will be textiled. If I leave out the escape characters then the first four characters vanish (the left tag, exclam. mark and the two dashes). If I surround it with escapes then I get
tags instead, with the whole comment showing. Neither shows an advertThis didn’t happen in Textile1, but I need 2’s functionality because 1 was being a pain wrapping p tags around everything. Can anybody help?
It appears that came out hopelessly wrong. You know what I mean with an HTML comment right? TIA.
You mean one of < !-- these -- >, but, as far as I know (and this is being parsed by Textile, as you can tell), there’s nothing preventing you from putting comments in your page.
Try viewing the source of this page. There should be two comments, one on either side of the bold “comments” above. You can also look at the post I made for the recent Textile 2.6 release, there’s a comment right in the main post that says “there’s a Jaykul comment here” so I’m sure it’s not Textile stripping it out…
Which version did you grab?
To reply to the question about math: – and + work fine, as long as there’s a space on either side of them. You could turn that feature off fairly simply: edit the file, go to the “fSpan” function and remove the line(s) defining them:
'-' => 'del',and'+' => 'ins',About the block quote, I’m not sure why it doesn’t work in that spot, but I have no intentions of adding features to Dean’s Textile parser, I want to keep them the same so that people can trust his documentation. The best bet is to raise this question on his blog or textpattern support forums
The
< notextile >blocks, and double = blocks work now, too (in 2.6) so I think most of the problems have been cleaned up.Thanks for the reply Jaykul.
I just updated to 2.6 and I’m making some progress: now if I use the notextile tag the whole part appears, but textile is still doing something since it’s changing the to HTML chracters (of the & number ; type). I can understand your plugin isn’t at fault, it appears to be a problem with the generator code, but it’s a little frustrating. Feel free to email me if you rather wouldn’t post a huge discussion in your comments page
Once again, thanks for your help so far.
To show what I mean, type the following into the Textile generator:
inside a <b> tag
lots of code ought to be able to go here
emphasized and strong, and all sorts of stuff.
The idea is that *stars* should stay *stars* and _underscores_ too!
Hypothetically, this ought to be in a span tag.==
I’ve sent a bug report from that page to Dean Allen.
Looks like the
==notextile==stuff is acting like hiscodeblocks used to. Ugh. You think he’d take my fixes if I could figure this out?[...] I’ve installed the new textile 2.6 plugin for Wordpress. [...]
[...] I’ve installed the new textile 2.6 plugin for Wordpress. [...]
I’ve installed your Textile 2.6 plugin and also the GeSHi plugin. For some reason when I write:
print (“Hello World”);
I see the pure HTML tags for the syntax highlighting. WordPress is not rendering the HTML for some reason.
I have the same problem as you James, from what i can guess the Textile plugin is getting the html after the GeSHi plugin colours it, then Textile converts the html into entities.
i tried using a Textile plugin that skipped over pre tags (what i was using to contain the source code) but it was just messing it up even more (wrapping the pre tags in another set of pre tags, then just generally messing with the html)
at the moment i have just disabled the source highlighting until i can find a working configuration.
If you use the “For Beautifiers” version, and set the priority of Geshi higher than that of Textile, you shouldn’t have any problems, although I seem to be getting an extra < br />. Of course, only I can get < code > (or anything else that looks like HTML) into these pages, so let me show by example:
Perl:
print $foo;
Html
<p>This is a paragraph with a <b>bold</b> word in it.</p>
<p>This is another paragraph with an <em>emphasized</em> word in it.</p>
</div>
[...] En estos dos casos existen plugins para WordPress, sin embargo, en mi caso particular me crean un problema bastante grande ya que al activarlos estropean el cA?digo de los posts anteriores, produciendo dificultades especialmente con los hipervA?nculos, pA?rrafos que se agregan de mA?s, etc. Lo ideal hubiese sido haberlos usado desde un comienzo, pero hasta ahora preferA?a escribir XHTML directamente, principalmente porque tenA?a acceso a todas sus posibilidades; sin embargo, desde la versiA?n 2.0 Textile, este lenguaje se ha convertido prA?cticamente en un meta-lenguaje de XHTML, que ofrece prA?cticamente todas sus posibilidades e incluso mA?s. Como contrapartida, es mA?s lento que sus anteriores versiones y puede llegar a ser una verdadera carga para tu servidor (en caso de que tu sitio sea intensamente visitado), pero para remediar esto existen otros plugins, tales como [...]
[...] Sin duda, este no es el A?nico factor a considerar al momento de fijarnos en el consumo de CPU, sino que tambiA?n es muy importante ponerle atenciA?n a los plugins que tenemos instalados y la cantidad de trabajo que implica servir cada pA?gina: por ejemplo, muchos ponen los A?ltimos comentarios en la pA?gina principal, y es sabido que algunos de los plugins que hacen esto implican mucho trabajo de CPU (p. ej: Brian’s Latest Comments, creo que se llama). FA?jense en el comentario que hace Mariano al post de Boja. Otro plugin que consume bastantes recursos es Textile, desde su versiA?n 2 en adelante (no pasa lo mismo con la primera versiA?n). [...]
[...] Los plugins generan una carga extra de trabajo, sobre todo aquellos filtros para el texto que escribimos, tales como Textile o los que generan muchas consultas a la base de datos, como Brian’s Latest Comments [...]
[...] One thing I do have to say is that I have grown attached to Textile which was built into Textpattern. Same maker. So I added Textile for WordPress 2.6 to my plugin list allowing me to continue to post entries using it. [...]
[...] Also, since you’re coming from Textpattern, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing Textile for WordPress. Trust me… You’ll want it. [...]
[...] On the individual post formatting front I’m also leaning towards standardizing on markdown rather than textile, but I will need to do some further investigatiion on the relevant post pluginformatting issues that WordPress 2.0 may have introduced. It looks like the Text Control plugin will allow me to switch between Textile and Markdown formatting relatively painlessly, but [Smarty Pants][] character encoding doesn’t seem to work properly at the moment. I’d investigate further, but it lets me set Textile as my default for all my old posts and specify Markdown on an individual post basis and that’s all I really need. [...]
[...] Achtung: das Preview-Template gibt den Inhalt mit der Funktion ‚textile()‘ aus. Wenn ihr das Textile-Plugin nicht installiert habt, entfernt die Funktion bitte aus dem Template, bevor ihr dieses einsetzt. [...]
[...] Il est disponible sur Site Textile [...]
There seems to be a bug with parsing link attributes. In this example, the link should have ‘oops’ as a class attribute. Instead, the parenthesised ‘oops’ appears as part of the link text.
link attribute test: (oops)link text
I think you mean to put “link text(oops)” which works like: link text
Jaykul, Tom is right. The plugin is not parsing class attributes correctly. “link text(oop)” would give a TITLE attribute of “oops.” Parentheses coming before the text should give a CLASS of “oops.”
I assign an “ext” class to all my external links. The parser bug is most frustrating.
I see what you mean … I think you will find that none of the attributes work on links in Textile at all (test here). Which is to say: this is not a problem with my plugin, which is merely a wrapper, it’s the way the Textile parser works. I am not usually prepared to alter the parser, since IMHO, these pseudo-markup languages are only useful when they work the same way everywhere…
PLEASE feel free to file bug reports:
http://www.textism.com/tools/textile/index.php
[...] Migrating content over from Textpattern was as simple as running a built-in script, which moved the content without any errors. The template migration was quite straightforward – I merged the XHTML/CSS (Cascading Style Sheets) from my old Textpattern templates with code taken from the great Minimalist Sandbox template. I then went through all my old content and removed the Textile (although had I wanted to continue with Textile there’s a plug-in available to run Textile in Wordpress). [...]
Send a comment