Archive Browser
Download cyotek.web.bbcodeformatter.zip, last updated 18/03/2010 (7.12 KB)
Download- md5: e33d27a1760bd48f92ea2556322c392f
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cyotek.Web.BbCodeFormatter
{
public static class PlainTextProcessor
{
static List<IHtmlFormatter> _formatters;
static PlainTextProcessor()
{
_formatters = new List<IHtmlFormatter>();
_formatters.Add(new SearchReplaceFormatter("\r", ""));
_formatters.Add(new SearchReplaceFormatter("\n\n", "</p><p>"));
_formatters.Add(new SearchReplaceFormatter("\n", "<br />"));
}
public static string Format(string data)
{
foreach (IHtmlFormatter formatter in _formatters)
data = formatter.Format(data);
return "<p>" + data + "</p>";
}
}
}
Donate
This software may be used free of charge, but as with all free software there are costs involved to develop and maintain.
If this site or its services have saved you time, please consider a donation to help with running costs and timely updates.
Donate