Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        /// <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());
        }
Ejemplo n.º 3
0
        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();
		}
Ejemplo n.º 4
0
		/// <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();
		}