public StringBuilder AddTextTag(StringBuilder sb, string name, TextGroupOptions options = null) { sb.AddTag("b", content: name); sb.Append(" "); sb.TextGroup(group: name, options: options); return(sb); }
public static string LinksOrText(TextGroupOptions options = null, bool breaks = false) { var tg = SB().TextGroup(options: options); List <StringBuilder> list = new List <StringBuilder>(); list.Add(SB().AddLink(content: tg.ToString(), cl: "[a-zA-Z0-9]+", classoptional: true)); list.Add(tg.TextGroup()); if (breaks) { list.Add(SB("<br>")); } return(((list.ToArray()).Options(min: 1, max: -1)).ToString()); }
public static StringBuilder TextGroup(this StringBuilder s, string group = null, TextGroupOptions options = null, int min = 1, int max = -1) { TextGroupOptions opt = (options != null) ? options : new TextGroupOptions(); string textPattern = ""; if (opt.dash) { textPattern += "-"; } if (opt.period) { textPattern += "\\."; } textPattern += "#×A-Za-z0-9'"; if (opt.space) { textPattern += " "; } if (opt.colon) { textPattern += ":"; } if (opt.semicolon) { textPattern += ";"; } if (opt.plus) { textPattern += "+"; } if (opt.comma) { textPattern += ","; } if (opt.paren) { textPattern += "()"; } if (opt.square) { textPattern += "\\[\\]"; } return(s.Group(text: textPattern.Wrap("[]").Quantify(min, max), name: group)); }
public static StringBuilder LinksOrText(this StringBuilder sb, TextGroupOptions options = null, bool breaks = false) { return(sb.Append(LinksOrText(options, breaks))); }