private static bool IsEnabled(ElementNode element) { if (element.Name != "img") return false; return element.HasAttribute("src"); }
public IHtmlSmartTag TryCreateSmartTag(ITextView textView, ITextBuffer textBuffer, ElementNode element, AttributeNode attribute, int caretPosition, HtmlPositionType positionType) { if (element.HasAttribute("ng-controller")) { return new HtmlAngularControllerSmartTag(textView, textBuffer, element); } return null; }
public override IList <IHtmlValidationError> ValidateElement(ElementNode element) { var results = new ValidationErrorCollection(); if (element.Name != "link" || !element.HasAttribute("rel") || !element.HasAttribute("type")) { return(results); } AttributeNode rel = element.GetAttribute("rel"); if (rel.Value.Equals("logo", StringComparison.Ordinal)) { AttributeNode type = element.GetAttribute("type"); if (!type.Value.Equals("image/svg", StringComparison.OrdinalIgnoreCase)) { int index = element.Attributes.IndexOf(type); results.AddAttributeError(element, "The type attribute value must be \"image/svg\" for rel=\"logo\" links.", HtmlValidationErrorLocation.AttributeValue, index); } } return(results); }
public bool HasSuggestedActions(ITextView textView, ITextBuffer textBuffer, int caretPosition, ElementNode element, AttributeNode attribute, HtmlPositionType positionType) { return(element.HasAttribute("ng-controller") || element.HasAttribute("data-ng-controller")); }
public bool IsMatch(ElementNode node) { return(node.IsTag(elementName) && node.HasAttribute(originalAttributeName)); }
public bool IsMatch(ElementNode node) { return node.IsTag(this.elementName) && node.HasAttribute(this.originalAttributeName); }
public bool Visit(ElementNode element, object parameter) { if (element.Name.Equals("datalist", StringComparison.OrdinalIgnoreCase) && element.HasAttribute("id")) { var list = (HashSet <string>)parameter; list.Add(element.GetAttribute("id").Value); } return(true); }