Journal
Textile Comments Fix
3 November 2005 › 11 comments
As of the 4.0.2 release of Textpattern, which for the most part, is really quite good, there’s an issue with how Textile parses comments. Textile is Textpattern’s built-in syntax handler, to create links and such, without using HTML. The reason this is beneficial in comments is to keep people from inputting HTML directly, and possible exploiting vulnerabilities in your website.
In the days before the 4.0.2 release, a light version of Textile was made available to people who wanted to leave a comment on a Textpattern site. This allowed them to make hyperlinks, add boldness or italics to text, do strike-through effects, etc. Some TXP users felt this wasn’t enough, and advocated for full Textile handling, so that people would be able to use blockquote and the like.
While this is all well and good, the 4.0.2 changes also opens the door for any other syntax that Textile is able to handle. This means that if people want to use your site headers, they can, even if you’ve styled your H1 to be your company logo or whatever. It also allows for people to input tables within their comments, something a CSS purist might frown upon.
Luckily, the person who goes by the username SHARK on the Textpattern forums came up with a solution. It involves hacking your txplib_misc.php file, in the /textpattern/lib/ directory. In case you’re not comfortable with hacking the PHP, but still want to force comments to behave correctly, you can download a replacement file here…
- 402-textile_fix.zip (12kb)
You will just need to replace this file with the old one. Though I have had no problems at all with this fix, I recommend backing up your old one, just in case. Please note, this is only for the Textpattern 4.0.2 release.
Discussion + Dissension
Comments closed after 2 weeks.



#1 Wesley Walser
That’s going to get frustrating to remember to do every time they release a new version of the software. I am surprised ,considering how robust Textile has become and how central it is to the software, that they haven’t built in more controls through the admin system.
In any case great recommendation. I am considering TXP for a new site, where comments would be a must, so I will have to remember this.
#2 Nathan Smith
Wesley: I’m guessing that in future releases, there will be more Textile control over comments. That’s complete speculation of course, but from the stink that has been raised over it on the forums, I’m sure it will need to be addressed.
#3 SHARK
Thanks for the credits :-)
#4 Nathan Smith
Hey, don’t mention it. I’m just glad you helped me / us wrangle Textile back under control. I’m thinking about switching to using WordPress for the next few projects I’ve got planned, just to have something that works by default.
#5 Yannick
Shark and Nathan: Thank you both for the quick fix.
#6 Nathan Smith
No problemo. I feel like a drug dealer when you say I hooked up up with a “quick fix,” but that’s just a matter of semantics. It’s a hack, plain and simple, much as I would like to call it a “patch” by SimpleBit’s definition. ;)
http://www.simplebits.com/notebook/2005/10/26/patches.html
#7 Yannick
LOL Nathan. You got anymore of the good stuff? hehe just kidding.
#8 Nathan Smith
‘Fraid not Yannick. Well, the first hit is free, but you don’t get anymore unless you either pay or get your friends hooked (I think that’s how it works).
#9 Rob
Thanks Nathan… I’ll just take the goods and run, it’s dangerous around these here parts. :)
#10 Nathan Smith
Rob: Thanks for continuing the analogy. I think in future Textpattern releases, there will be greater control over how Textile is handled. They’ve even hinted at allowing for entirely different syntax (Markdown anyone?), but that remains to be seen. For now, I’m using this hack to keep my comments formatted at a manageable level.
#11 Justin Perkins
Thanks, worked great for me. I just did a random search on your site for “textpattern” because I wanted to see how your live search worked and man did I hit the jackpot.
I’ve been performing your mods all day long.
Thanks a million Nathan :)