using System.Text.RegularExpressions;
public static void Main()
<p>some text and again some texts
http://link.out/ normal text</p>
<a href=""http://link.out"">link</a>";
var doc = new HtmlDocument();
Regex r = new Regex(@"(https?://[^\s]+)");
var textNodes = doc.DocumentNode.SelectNodes("//text()");
foreach (var textNode in textNodes) {
var text = textNode.GetDirectInnerText();
var withLinks = r.Replace(text, "<a href=\"$1\">$1</a>");
textNode.InnerHtml = withLinks;
Console.WriteLine(doc.DocumentNode.InnerHtml);