Eaf.HtmlSanitizer
9.4.6
Prefix Reserved
dotnet add package Eaf.HtmlSanitizer --version 9.4.6
NuGet\Install-Package Eaf.HtmlSanitizer -Version 9.4.6
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="Eaf.HtmlSanitizer" Version="9.4.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eaf.HtmlSanitizer" Version="9.4.6" />
<PackageReference Include="Eaf.HtmlSanitizer" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Eaf.HtmlSanitizer --version 9.4.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Eaf.HtmlSanitizer, 9.4.6"
#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.
#:package Eaf.HtmlSanitizer@9.4.6
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Eaf.HtmlSanitizer&version=9.4.6
#tool nuget:?package=Eaf.HtmlSanitizer&version=9.4.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Eaf.HtmlSanitizer
Módulo EAF para sanitização de HTML baseado no HtmlSanitizer, removendo scripts, atributos de eventos e URIs javascript: por padrão.
Dependências
Abp10.5.0HtmlSanitizer9.0.892
Uso
[DependsOn(typeof(EafHtmlSanitizerModule))]
public class MyProjectModule : AbpModule
{
}
public class MyService : ITransientDependency
{
private readonly IHtmlSanitizer _htmlSanitizer;
public MyService(IHtmlSanitizer htmlSanitizer)
{
_htmlSanitizer = htmlSanitizer;
}
public void Process(string input)
{
var safeHtml = _htmlSanitizer.Sanitize(input);
}
}
Configuração
var options = new EafHtmlSanitizerOptions
{
AllowedTags = { "p", "strong", "em" },
AllowedAttributes = { "style" },
AllowedUriSchemes = { "https", "mailto" }
};
var safe = htmlSanitizer.Sanitize(input, options);
Quando as coleções estiverem vazias, o módulo utiliza as configurações padrão do sanitizer.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Abp (>= 10.5.0)
- HtmlSanitizer (>= 9.0.892)
- MessagePack (>= 2.5.301)
- System.Security.Cryptography.Xml (>= 10.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.4.6 | 48 | 8/18/2026 |