11
Jan
2007
HTML in Your CS Comments
A while back, I was provided with a solution to the problem of allowing HTML in my blog comments by Jayson Knight. This involved modifying the SafeFeedback method in the Community Server source code and rebuilding the module. While that works, I chose to implement it as a complete CS module of its own. Why do this? Because the fewer changes that I make to the CS source code, the easier things are to deal with when I have to upgrade. As long as the changes to the stock FeedbackHtmlFormatting module are minimal (or nonexistant, as they were with 2.1 SP1 and SP2), I can upgrade the product without having to reimplement my modifications.
So now, after much procrastination, I've packaged up a new version of NinjaFish.CommunityServer. The only change here is the addition of a new CSModule, FeedbackHtmlFormatting. This module shares a name with one of the stock CS modules because it is intended as a replacement.
The version of FeedbackHtmlFormatting that is included in this assembly provides the exact same functionality as the original version, but will allow limited HTML (the same HTML as in your forum post configuration) to pass through into the comment body. It provides the addition restriction that image tags are not allowed (they are converted into plain text links) and repeated links are not converted into HTML links.
I tried to make the link detection reasonably robust in order to keep the comments from becoming obnoxious, but I'll be the first to admit that I probably didn't think of everything. As always, the source code is included, so feel free to customize the SafeFeedback method for your own needs.
And, of course, the module is running on this blog, so feel free to play with it.