Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Sueetie Wall Messages Go Inline (Code)

Sueetie Wall Messages now support the display of inline code blocks.  This may seem like a simple feature to add, but converting the message to simple HTML and preserve multiple coding blocks made it interesting.  Message are normally first stripped of all HTML and line breaks replaced with </p><p> tags.  That wouldn't work to preserve HTML and other code types, so the approach I used was to convert the message string to a StringReader and applying logic line-by-line.

All Code Types on Wall Messages are displayed with the same styling for a consistent look on the wall.  Inline Code is inserted using BBCode [code][/code] tags, which are converted to the following HTML when the message is saved.

<pre class="code">...</pre>

You can customize the icon used for inserting code, just as you can with attached images, files and other functions. Below is the icon used on Sueetie.com for inserting code in a wall message and the BBCode which is appended to the message. You then insert your code between the two "code" tags.

Image

Here is what is displayed when the message to saved to the wall. You can modify how your inline code appears by styling your wall.css "code" class.

Image

Comments (0) | Post RSS RSS comment feed

Posted on 1/4/2012 10:33:02 AM by Dave Burke
Categories: Sueetie
Tags:

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke