Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 public static string MakeAttribute(WRAttribute attr)
 {
     return(MakeAttribute(attr.attribute, attr.value, attr.group, attr.optional));
 }
Ejemplo n.º 3
0
 public static StringBuilder AppendAttribute(this StringBuilder s, WRAttribute attr)
 {
     return(s.Append(MakeAttribute(attr)));
 }
Ejemplo n.º 4
0
        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();
        }