Pete Freitag Pete Freitag

Textile for ColdFusion

Updated on December 06, 2023
By Pete Freitag
coldfusion

A few weeks ago I mentioned that I had an open source project in the pipeline. Well I've been really busy so I haven't had a chance to release it until now...

I built a UDF for converting textile markup into HTML markup.

You can learn more about textile here. My UDF doesn't support all the features of textile yet, but it does have quite a few of them.

Download the ColdFusion UDF for Textile.

BTW you should see this in some upcoming projects from foundeo.



textile html udf coldfusion cfml foundeo

Textile for ColdFusion was first published on February 13, 2006.

If you like reading about textile, html, udf, coldfusion, cfml, or foundeo then you might also like:

FuseGuard Web App Firewall for ColdFusion

The FuseGuard Web Application Firewall for ColdFusion & CFML is a high performance, customizable engine that blocks various attacks against your ColdFusion applications.

CFBreak
The weekly newsletter for the CFML Community


Comments

Textpattern, which powers The Tuna Ranch has textile support, and it's quite nice, but I still prefer markdown.
by TunaRanch on 02/13/2006 at 4:41:54 PM UTC
Thank you, thank you. Textile and markdown support are long overdue for CF. You are a god.
by John Paul Ashenfelter on 02/27/2006 at 3:28:23 AM UTC
Great stuff Pete - this is something I'd been looking for for ages, and was on the verge of trying to write it myself...
by Seb Duggan on 02/27/2006 at 9:57:10 PM UTC
Pete - I sent some updates via your form to fix some bugs in the UDF. Right now the regexps for bolding, striking and so forth don't do enough checking to prevent mistakes from popping up. Like if you have more than one word bolded in a line it bolds from start * to end *. My fixes should correct that for you.

Thanks for the work, I integrated it into Ray's Galleon 1.5 forum package and both things into my application and it's looking good!
by Brian on 03/01/2006 at 4:35:58 AM UTC
After looking at ways to improve on this, I realised how complex the original Textile parser is! And so I came up with a way to save me some time...

Seeing as I've got PHP installed on my web server to run forums, I've created a UDF which uses CFHTTP to run the source text through the PHP parser, and return it. I've also tweaked it to give the option of HTML or XHTML output...

The advantages are (1) it is the official release of Textile, so should be pretty much correct! and (2) if they update Textile, I can just drop in the revised PHP page and it's up to date.

Pete - I do however wish you every success in developing the CF version...
by Seb Duggan on 03/03/2006 at 12:40:31 PM UTC
As well as Textile, I'd also been waiting for someone to port Markdown to ColdFusion - until I realised that someone had already done nearly all the work!

So, I have taken MarkdownJ - a perfect Java port of Markdown - and turned it into CFX_Markdown, a Java-based CFX tag.

I have today released it into the wild - if any of you are interested in trying it out, you can get it from my website:

http://sebduggan.com/CFX_Markdown/
by Seb Duggan on 10/17/2006 at 10:12:55 AM UTC
Hi Peter, we are all delighted with this UDf - kudos.

However as Brian says, I think they are a few tiny mistakes.

For example I had: "levels have inter-linkage and a search option is provided on all pages.. ..for improvements / add-ons" and it STRIKEd-out everything from "inter" to "/ add".

Can you release Brian's updated version?
by Topper on 11/08/2007 at 3:48:44 AM UTC
Thanks so much for building this component, Pete!

I found a bug, though! The check to see whether you should end an unordered list doesn't trim the next line in the input before checking its length (which you do in the same check for the ordered list handler); this causes the list never to end because even a blank line has a carriage return on it.

This is the original:
<cfif index+1 GT lines OR NOT len(lineArray[index+1])>

And my fix:
<cfif index+1 GT lines OR NOT len(trim(lineArray[index+1]))>

Works brilliantly, cheers!
by Aaron on 12/12/2007 at 6:48:55 AM UTC
I realize that you posted this years ago but I noticed a bug(?). I've only used the demo so it may be a problem with that instead of the UDF.

If you do a single item list, anything after that list disappears.

Here is the text I used
"
* There should be two blank lines after a list, even if there is nothing after it!


However, this one has something after it!
"
by sunshine on 05/26/2011 at 11:57:41 AM UTC