HtmlLinkValidator 1.1.2
dotnet add package HtmlLinkValidator --version 1.1.2
NuGet\Install-Package HtmlLinkValidator -Version 1.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HtmlLinkValidator" Version="1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HtmlLinkValidator --version 1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HtmlLinkValidator, 1.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install HtmlLinkValidator as a Cake Addin
#addin nuget:?package=HtmlLinkValidator&version=1.1.2
// Install HtmlLinkValidator as a Cake Tool
#tool nuget:?package=HtmlLinkValidator&version=1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FIXED TLS 2.0 ERROR
This package depends on Html Agility Pack: http://html-agility-pack.net/ https://www.nuget.org/packages/HtmlAgilityPack/ https://github.com/zzzprojects/html-agility-pack/blob/master/LICENSE
Example:
...
using HtmlLinkValidator;
public void SendEmails(List<string> emails)
{
LinkValidator validator = new LinkValidator();
// Will write to the console every link that is checked, false by default
validator.SetLinkStack(true);
//strings you add here will be filtered out during validation
validator.GetLinkFilter().Add("google");
foreach (string htmlEmail in emails)
{
var validationResult = validator.ValidateHtml(htmlEmail);
if (validationResult.IsValid)
{
// will skip over any matching html strings that you add here
validator.GetSkipOver().Add(htmlEmail);
_emailHelper.SendEmail(htmlEmail);
}
else
{
foreach(string errMsg in validationResult.ErrorMessages)
{
Console.WriteLine(errMsg);
}
}
}
};
Adding to your config may improve performance:
<system.net>
<connectionManagement>
<add address="*" maxconnection="999" />
</connectionManagement>
</system.net>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- HtmlAgilityPack (>= 1.8.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.