RockFluid.MarkupSanity
1.0.1
See the version list below for details.
dotnet add package RockFluid.MarkupSanity --version 1.0.1
NuGet\Install-Package RockFluid.MarkupSanity -Version 1.0.1
<PackageReference Include="RockFluid.MarkupSanity" Version="1.0.1" />
paket add RockFluid.MarkupSanity --version 1.0.1
#r "nuget: RockFluid.MarkupSanity, 1.0.1"
// Install RockFluid.MarkupSanity as a Cake Addin #addin nuget:?package=RockFluid.MarkupSanity&version=1.0.1 // Install RockFluid.MarkupSanity as a Cake Tool #tool nuget:?package=RockFluid.MarkupSanity&version=1.0.1
Uses HtmlAgilityPack parser to protect against cross-site scripting by sanitizing html text against unrecognized tags and attributes.
HTML is matched against defined whitelisted tags and attributes to ensure only known safe markups are allowed.
Basic usage:
String inputValue = "<a onclick="javascript:alert('Gotcha!');" href="javascript:alert('Gotcha again!');">Click Me</a>";
String cleanValue = inputValue.SanitizeHtml();
Console.Writeline(cleanValue);
More information is available in the project site's wiki.
What's New?
- Added a comprehensive list of default whitelisted tags and attributes.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
-
- HtmlAgilityPack (>= 1.6.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added comprehensive list of default whitelists for tags and attributes.