private bool IsUnSafe(HtmlAttribute attribute) { if (_unsafe.Contains(attribute.Name)) return true; if (!string.IsNullOrEmpty(attribute.Value)) { string val = attribute.Value.TrimStart(new char[] { ' ' }).ToLowerInvariant(); if (val.StartsWith("javascript")) return true; } return false; }
public HtmlImageInfo(HtmlElement element) { Element = element; _src = element.Attributes.FirstOrDefault(p => p.Name == "src"); }
public void Add(string name, string value) { var item = new HtmlAttribute { Name = name.ToLower(), Value = value }; this._attributes[name.ToLower()] = item; }