private static void Entitize(HtmlAttributeCollection collection) { foreach (HtmlAttribute current in (IEnumerable <HtmlAttribute>)collection) { current.Value = HtmlEntity.Entitize(current.Value); } }
public static HtmlNode Entitize(HtmlNode node) { if (node == null) { throw new ArgumentNullException("node"); } HtmlNode htmlNode = node.CloneNode(true); if (htmlNode.HasAttributes) { HtmlEntity.Entitize(htmlNode.Attributes); } if (htmlNode.HasChildNodes) { HtmlEntity.Entitize(htmlNode.ChildNodes); } else { if (htmlNode.NodeType == HtmlNodeType.Text) { ((HtmlTextNode)htmlNode).Text = HtmlEntity.Entitize(((HtmlTextNode)htmlNode).Text, true, true); } } return(htmlNode); }
private static void Entitize(HtmlNodeCollection collection) { foreach (HtmlNode current in (IEnumerable <HtmlNode>)collection) { if (current.HasAttributes) { HtmlEntity.Entitize(current.Attributes); } if (current.HasChildNodes) { HtmlEntity.Entitize(current.ChildNodes); } else { if (current.NodeType == HtmlNodeType.Text) { ((HtmlTextNode)current).Text = HtmlEntity.Entitize(((HtmlTextNode)current).Text, true, true); } } } }
public static string Entitize(string text, bool useNames) { return(HtmlEntity.Entitize(text, useNames, false)); }
public static string Entitize(string text) { return(HtmlEntity.Entitize(text, true)); }