private bool IsPostLink(IHtmlNode node) { if (!node.Name.EqualsNc("a")) { return(false); } if (node.GetAttributeValue("href", null) == null) { return(false); } if ("post-reply-link".Equals(node.GetAttributeValue("class", null), StringComparison.OrdinalIgnoreCase)) { } else { if (node.GetAttributeValue("onclick", null) == null) { return(false); } if (!node.GetAttributeValue("onclick", "").StartsWith("highlight", StringComparison.OrdinalIgnoreCase)) { return(false); } } return(_linkParser.IsLinkForEngine(node.GetAttributeValue("href", ""), true)); }
private void C_GetDataPoint(IHtmlNode node) { this.DataPoints.Add(new DataPoint( name: node.GetAttributeValue("data-test").Replace("-value", ""), value: node.GetFirstChild().GetText() )); }
private ParseContext CreateLinkAttrNode(IHtmlNode node, ParseContext res) { var linkUri = GetLinkText(node.GetAttributeValue("href", null)); var detectedLink = _linkParser.TryParseLink(linkUri, true); if (detectedLink != null) { return(CreateNode(res, new PostLinkAttribute() { Link = detectedLink })); } var youtubeId = _youtubeIdService.GetYoutubeIdFromUri(linkUri); if (youtubeId != null) { return(CreateNode(res, new PostLinkAttribute() { Link = new YoutubeLink() { YoutubeId = youtubeId } })); } return(CreateNode(res, new PostLinkAttribute() { Link = new UriLink() { Uri = linkUri } })); }
private bool CheckSpan(IHtmlNode node, string className) { if (!node.Name.EqualsNc("span")) { return(false); } return(node.GetAttributeValue("class", null).EqualsNc(className)); }
private ParseContext AddPostLink(IHtmlNode node, ParseContext result) { var href = node.GetAttributeValue("href", ""); var link = _linkParser.TryParseLink(href, true); if (link != null) { result.Nodes.Add(new BoardLinkPostNode() { BoardLink = link }); } return(result); }