..\packages\NUnit.3.2.1\lib\net45\nunit.framework.dll
True
diff --git a/HtmlSanitizer.Tests/Tests.cs b/HtmlSanitizer.Tests/Tests.cs
index 09ece97..8544f4d 100644
--- a/HtmlSanitizer.Tests/Tests.cs
+++ b/HtmlSanitizer.Tests/Tests.cs
@@ -1,7 +1,6 @@
using AngleSharp.Dom;
using AngleSharp.Dom.Html;
using AngleSharp.Parser.Html;
-using Ganss.Text;
using NUnit.Framework;
using System;
using System.Collections.Generic;
@@ -2174,13 +2173,12 @@ rl(javascript:alert(""foo""))'>";
public void AutoLinkTest()
{
var sanitizer = new HtmlSanitizer();
- var autolink = new AutoLink();
sanitizer.PostProcessNode += (s, e) =>
{
var text = e.Node as IText;
if (text != null)
{
- var autolinked = autolink.Link(text.NodeValue);
+ var autolinked = Regex.Replace(text.NodeValue, @"https?://[^\s]+[^\s!?.:;,]+", m => $@"{m.Value}", RegexOptions.IgnoreCase);
if (autolinked != text.NodeValue)
{
var f = new HtmlParser().Parse(autolinked);
@@ -2191,7 +2189,7 @@ rl(javascript:alert(""foo""))'>";
};
var html = @"Click here: http://example.com/.
";
Assert.That(sanitizer.Sanitize(html), Is.EqualTo(@"").IgnoreCase);
- Assert.That(sanitizer.Sanitize("Check out www.google.com."), Is.EqualTo(@"Check out www.google.com.").IgnoreCase);
+ Assert.That(sanitizer.Sanitize("Check out https://www.google.com."), Is.EqualTo(@"Check out https://www.google.com.").IgnoreCase);
}
[Test]
diff --git a/HtmlSanitizer.Tests/packages.config b/HtmlSanitizer.Tests/packages.config
index ad08135..ce8463e 100644
--- a/HtmlSanitizer.Tests/packages.config
+++ b/HtmlSanitizer.Tests/packages.config
@@ -1,7 +1,5 @@
-
-
\ No newline at end of file