public void should_ignore_urls_starting_with_ww_http_and_https(string imageUrl) { // Arrange HtmlImageTag htmlImageTag = new HtmlImageTag(imageUrl, imageUrl, "alt", "title"); // Act HtmlImageTag actualTag = _srcParser.Parse(htmlImageTag); // Assert imageUrl.ShouldBe(actualTag.Src); }
public MarkdigParser Create(IPageRepository pageRepository, TextSettings textSettings, IUrlHelper urlHelper) { var markdigParser = new MarkdigParser(); // When a link is parsed, use the LinkHrefParser markdigParser.LinkParsed = htmlLinkTag => { var tokenParser = new LinkHrefParser(pageRepository, textSettings, urlHelper); htmlLinkTag = tokenParser.Parse(htmlLinkTag); return(htmlLinkTag); }; // When an image is parsed, use the ImageSrcParser markdigParser.ImageParsed = htmlImageTag => { var provider = new ImageSrcParser(textSettings, urlHelper); htmlImageTag = provider.Parse(htmlImageTag); return(htmlImageTag); }; return(markdigParser); }