public static StringBuilder AddLink(this StringBuilder s, string content, string cl = null, bool classoptional = false, int min = groupmin, int max = groupmax, bool ungreedy = false, IEnumerable <WRAttribute> attributes = null) { List <WRAttribute> list = new List <WRAttribute>(); list.Add(WRAttribute.Url()); list.AddRangeIfNotNull(attributes); return(s.AddTag("a", content, cl, classoptional, min, max, ungreedy, list)); }
public static string MakeAttribute(WRAttribute attr) { return(MakeAttribute(attr.attribute, attr.value, attr.group, attr.optional)); }
public static StringBuilder AppendAttribute(this StringBuilder s, WRAttribute attr) { return(s.Append(MakeAttribute(attr))); }
void AddToRough(StringBuilder sb) { var persb = SB(); persb.Append("; "); var open = SB().AddOpenTag("a", cl: "[-_a-zA-Z0-9]+", attributes: new[] { WRAttribute.Url() }, classoptional: true); var front = " ?" + open.ToString().Wrap("()") + "?"; var mid = SB().Group(WRRegexUtils.TextPatternNoComma, name: "peritem").ToString(); var back = "(</a>" + SB().Group(WRRegexUtils.TextPatternNoCommaOpt, name: "perend").ToString() + ")?"; string endGroup = "(, |</)"; var all = (front + mid + back + endGroup).Wrap("()") + "*"; all.SpitFile("rough.txt"); persb.Append(all); string rough = persb.ToString(); sb.Append(rough); sb.Append("p>").Whitespace(); }