-
|
Whichever configuration I try - Does anybody know what's the point and how to prevent it? UPDATE: code to reproduce the issue: using AngleSharp.Html;
using Ganss.Xss;
var html = "<h1 style=\"text-align:start;\">Title</h1>";
var options = new HtmlSanitizerOptions()
{
AllowedTags =
{
"h1",
},
AllowedAttributes =
{
"style"
},
AllowedCssProperties =
{
"text-align"
}
};
var sanitizer = new HtmlSanitizer(options);
var sanitizedHtml = sanitizer.Sanitize(html, outputFormatter: new PrettyMarkupFormatter());
Console.WriteLine(sanitizedHtml);Expected output: Actual output: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Answering to myself: This library has nothing to do with the removal of this style, instead it is outdated Currently it works with beta version of nuget |
Beta Was this translation helpful? Give feedback.
-
|
Perhaps you can try the prerelease version of HtmlSanitizer, in practice it's as stable as the current release but depends on newer versions of AngleSharp and AngleSharp.Css. |
Beta Was this translation helpful? Give feedback.
Answering to myself: This library has nothing to do with the removal of this style, instead it is outdated
AngleSharp.Cssdependency that does not recognizetext-align: start, specifically thestartpart.Currently it works with beta version of nuget
9.1.878-beta(newer version do not work with .NET 6 at the time of writing).