public override string BuildHtml(UbbParser parser, string param, string content) { content = parser.DoUbbToHtml(content, CleanFooter); while(StringUtil.StartsWithIgnoreCase(content, "<br />")) content = content.Remove(0, 6); while (StringUtil.EndsWithIgnoreCase(content, "<br />")) content = content.Remove(content.Length-6); return string.Concat( @"<div class=""maxcode-quote"">" , content , "</div>" ); }
public override string BuildHtml(UbbParser parser, string param, string content) { if (string.IsNullOrEmpty(param)) { m_HtmlTagName = "ul"; } else { m_HtmlTagName = "ol"; } HtmlTextWriter writer = parser.GetHtmlTextWriter(); writer.WriteBeginTag(this.HtmlTagName); //TODO:重载 BuildAttribute(writer, param, content); writer.Write(HtmlTextWriter.TagRightChar); content = content.TrimStart(); if (StringUtil.StartsWith(content, "[*]") == false) { int tmp = content.IndexOf("[*]"); if (tmp > 0) { content = content.Substring(tmp); } } string parsedContent = parser.DoUbbToHtml(content, false); int itemCount = ParseListItem(parsedContent, out parsedContent); writer.Write(parsedContent); if (itemCount > 0) { writer.WriteEndTag("li"); } writer.WriteEndTag(this.HtmlTagName); return(writer.InnerWriter.ToString()); }
public override string BuildHtml(UbbParser parser, string param, string content) { content = parser.DoUbbToHtml(content, CleanFooter); while (StringUtil.StartsWithIgnoreCase(content, "<br />")) { content = content.Remove(0, 6); } while (StringUtil.EndsWithIgnoreCase(content, "<br />")) { content = content.Remove(content.Length - 6); } return(string.Concat( @"<div class=""maxcode-quote"">" , content , "</div>" )); }
/// <summary> /// 创建HTML /// </summary> /// <param name="parser">解析器</param> /// <param name="param">UBB参数</param> /// <param name="content">UBB内容</param> /// <returns>HTML结果</returns> public virtual string BuildHtml(UbbParser parser, string param, string content) { HtmlTextWriter writer = parser.GetHtmlTextWriter(); writer.WriteBeginTag(this.HtmlTagName); BuildAttribute(writer, param, content); if (IsSingleHtmlTag) { writer.Write(HtmlTextWriter.SelfClosingTagEnd); } else { writer.Write(HtmlTextWriter.TagRightChar); writer.Write(parser.DoUbbToHtml(content, CleanFooter)); writer.WriteEndTag(this.HtmlTagName); } return(writer.InnerWriter.ToString()); }
public override string BuildHtml(UbbParser parser, string param, string content) { if(string.IsNullOrEmpty(param)) m_HtmlTagName = "ul"; else m_HtmlTagName = "ol"; HtmlTextWriter writer = parser.GetHtmlTextWriter(); writer.WriteBeginTag(this.HtmlTagName); //TODO:重载 BuildAttribute(writer, param, content); writer.Write(HtmlTextWriter.TagRightChar); content = content.TrimStart(); if(StringUtil.StartsWith(content, "[*]") == false) { int tmp = content.IndexOf("[*]"); if(tmp > 0) content = content.Substring(tmp); } string parsedContent = parser.DoUbbToHtml(content, false); int itemCount = ParseListItem(parsedContent, out parsedContent); writer.Write(parsedContent); if(itemCount > 0) writer.WriteEndTag("li"); writer.WriteEndTag(this.HtmlTagName); return writer.InnerWriter.ToString(); }
/// <summary> /// 创建HTML /// </summary> /// <param name="parser">解析器</param> /// <param name="param">UBB参数</param> /// <param name="content">UBB内容</param> /// <returns>HTML结果</returns> public virtual string BuildHtml(UbbParser parser, string param, string content) { HtmlTextWriter writer = parser.GetHtmlTextWriter(); writer.WriteBeginTag(this.HtmlTagName); BuildAttribute(writer, param, content); if (IsSingleHtmlTag) writer.Write(HtmlTextWriter.SelfClosingTagEnd); else { writer.Write(HtmlTextWriter.TagRightChar); writer.Write(parser.DoUbbToHtml(content, CleanFooter)); writer.WriteEndTag(this.HtmlTagName); } return writer.InnerWriter.ToString(); }