An alternative to UBB.threads
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
FLocal/Common/BBCodes/QuoteSkipper.cs

50 lines
1.3 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PJonDevelopment.BBCode;
namespace FLocal.Common.BBCodes {
class QuoteSkipper : BBCode {
public QuoteSkipper() : base("quoteskipper") {
}
public override string Format(ITextFormatter formatter) {
if(this.Name.ToLower() == "q" || this.Name.ToLower() == "quote") {
return "";
} else if(this.Name.ToLower() == "code") {
return "[code]" + this.InnerBBCode + "[/code]";
} else {
string name = this.Name;
if(name.ToLower() == "uploadimage") name = "uploadLink";
var sb = new StringBuilder();
sb.Append("[");
sb.Append(name);
if(this.Default != null && this.Default != "") {
sb.Append("='");
sb.Append(this.Default.Replace("'", "''"));
sb.Append("'");
} else {
foreach(var attribute in this.Attributes) {
sb.Append(" ");
sb.Append(attribute.Key);
sb.Append("='");
sb.Append(attribute.Value.Replace("'", "''"));
sb.Append("'");
}
}
sb.Append("]");
if(this.RequireClosingTag) {
sb.Append(this.GetInnerHTML(formatter));
sb.Append("[/");
sb.Append(name);
sb.Append("]");
}
return sb.ToString();
}
}
}
}