Skip to content

Commit a438eaa

Browse files
authored
Merge pull request #572 from DerAtro/net80Tfm
Introduced net8.0 TFM
2 parents 84b4f81 + 44fdc32 commit a438eaa

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ HtmlSanitizer
88

99
[![netstandard2.0](https://img.shields.io/badge/netstandard-2.0-brightgreen.svg)](https://img.shields.io/badge/netstandard-2.0-brightgreen.svg)
1010
[![net46](https://img.shields.io/badge/net-461-brightgreen.svg)](https://img.shields.io/badge/net-461-brightgreen.svg)
11+
[![net8.0](https://img.shields.io/badge/net-8.0-brightgreen.svg)](https://img.shields.io/badge/net-461-brightgreen.svg)
1112

1213
HtmlSanitizer is a .NET library for cleaning HTML fragments and documents from constructs that can lead to [XSS attacks](https://en.wikipedia.org/wiki/Cross-site_scripting).
1314
It uses [AngleSharp](https://github.com/AngleSharp/AngleSharp) to parse, manipulate, and render HTML and CSS.

src/HtmlSanitizer/HtmlSanitizer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ protected static string DecodeCss(string css)
874874
if (iri != null && !iri.IsAbsolute && !string.IsNullOrEmpty(baseUrl))
875875
{
876876
// resolve relative URI
877-
if (Uri.TryCreate(baseUrl, UriKind.Absolute, out Uri baseUri))
877+
if (Uri.TryCreate(baseUrl, UriKind.Absolute, out Uri? baseUri))
878878
{
879879
try
880880
{

src/HtmlSanitizer/HtmlSanitizer.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<FileVersion>$(AppVeyor_Build_Version).0</FileVersion>
1111
<PackageVersion>$(AppVeyor_Build_Version)</PackageVersion>
1212
<Authors>Michael Ganss</Authors>
13-
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
13+
<TargetFrameworks>net461;netstandard2.0;net8.0</TargetFrameworks>
1414
<AssemblyName>HtmlSanitizer</AssemblyName>
1515
<AssemblyOriginatorKeyFile>HtmlSanitizer.snk</AssemblyOriginatorKeyFile>
1616
<SignAssembly>true</SignAssembly>
@@ -42,6 +42,12 @@
4242
<PackageReference Include="AngleSharp" Version="[0.17.1]" />
4343
<PackageReference Include="AngleSharp.Css" Version="[0.17.0]" />
4444
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
45+
</ItemGroup>
46+
47+
<ItemGroup Condition=" '$(TargetFramework)' == 'net461'">
48+
<PackageReference Include="System.Collections.Immutable" Version="9.0.1" />
49+
</ItemGroup>
50+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
4551
<PackageReference Include="System.Collections.Immutable" Version="9.0.1" />
4652
</ItemGroup>
4753

0 commit comments

Comments
 (0)