示例#1
0
        /// <summary>
        /// Gets the first paragraph from the given html field.
        /// </summary>
        /// <param name="html">The field</param>
        /// <returns>The first paragraph</returns>
        public static string FirstParagraph(Extend.Fields.HtmlField html)
        {
            Regex reg     = new Regex("<p[^>]*>.*?</p>");
            var   matches = reg.Matches(html.Value);

            return(matches.Count > 0 ? matches[0].Value : "");
        }
 public static HtmlString Html(this Piranha.Extend.Fields.HtmlField field)
 {
     return(new HtmlString(field.Value));
 }