free geoip Enable Markup In Community Server Blog Comments - Jayson's Blog - jaysonKnight.com
jaysonKnight.com
Welcome to my corner of the internet
Enable Markup In Community Server Blog Comments

I recently added a live comment preview box to the comment page on my blog.  While it sure is pretty, it didn’t really do much as Community Server doesn’t support markup in comments out of the box.  The fix to enable this is easy enough:  In CommunityServer.Components.Formatter, there is a static method called SafeFeedBack.  In this method, a call is made to Globals.HtmlEncode, which is just a wrapper around Web.HttpUtility.HtmlEncode (which of course strips out all markup from a string).  Comment this out, and add a call to HtmlScrubber.Clean(text, false, true) right above the block that replaces linebreaks with break tags.  The 3rd boolean parameter tells CS to still strip out script tags, so this should be safe to use.  If any of the Telligenti have a compelling argument as to why this wouldn’t be safe, feel free to share.

So now not only do I have the purdy live comment preview, it actually works as well.  As Phil stated, the next step is to automate this a little more…I’ll knock that out within the next couple of days.  In the meantime, knock yourselves out with markup in your comments on JK.com.


Posted Tue, Mar 14 2006 6:37 PM by Jayson Knight

Comments

Haacked wrote re: Enable Markup In Community Server Blog Comments
on Wed, Mar 15 2006 4:52 AM
Probably safer to filter out anything not explicitely allowed rather than just scrubbing script tags.  For example, does it filter out  and ?
Haacked wrote re: Enable Markup In Community Server Blog Comments
on Wed, Mar 15 2006 4:52 AM
apparently not.
Haacked wrote re: Enable Markup In Community Server Blog Comments
on Wed, Mar 15 2006 4:57 AM
I meant "apparently so".
Jayson Knight wrote re: Enable Markup In Community Server Blog Comments
on Wed, Mar 15 2006 10:08 AM
Yeah, there's a section in one of the CS config files that allows the site admin to specify which tags are allowed...this is the list that the HtmlScrubber class validates against.  If it's not explicitely allowed, it gets stripped out.
Souplog wrote Community Server Roundup
on Wed, Apr 12 2006 2:59 PM
Hell, people are up to some interesting Community Server stuff:
Keyvan Nayyeri posted two cool new CS...
Souplog wrote Community Server Roundup
on Mon, Jul 31 2006 6:43 AM

Hell, people are up to some interesting Community Server stuff: Keyvan Nayyeri posted two cool new CS

Add a Comment

(optional)  
(optional)
(required)  
Remember Me?

Copyright © :: JaysonKnight.com
External Content © :: Respective Authors

Terms of Service/Privacy Policy