Bring back net45 target

This commit is contained in:
Nicolas Musset
2020-08-16 12:31:03 +09:00
parent 4f7ef61303
commit db867dee48
5 changed files with 22 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net452;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<OutputType>Library</OutputType>
<IsPackable>false</IsPackable>
</PropertyGroup>

View File

@@ -6,7 +6,7 @@
<NeutralLanguage>en-US</NeutralLanguage>
<VersionPrefix>0.20.0</VersionPrefix>
<Authors>Alexandre Mutel</Authors>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net452;netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<PackageTags>Markdown CommonMark md html md2html</PackageTags>
<PackageReleaseNotes>https://github.com/lunet-io/markdig/blob/master/changelog.md</PackageReleaseNotes>
<PackageLicenseExpression>BSD-2-Clause</PackageLicenseExpression>
@@ -20,6 +20,10 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<PackageReference Include="System.Memory" Version="4.5.4" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Memory" Version="4.5.4" />
</ItemGroup>

View File

@@ -27,7 +27,11 @@ namespace Markdig.Syntax
/// <param name="parser">The parser used to create this block.</param>
protected ContainerBlock(BlockParser parser) : base(parser)
{
#if NET452
children = new Block[0];
#else
children = Array.Empty<Block>();
#endif
}
/// <summary>

View File

@@ -99,7 +99,11 @@ namespace Markdig.Syntax.Inlines
{
if (FirstChild is null)
{
#if NET452
return new T[0];
#else
return Array.Empty<T>();
#endif
}
else
{

View File

@@ -94,7 +94,11 @@ namespace Markdig.Syntax
}
}
#if NET452
return new T[0];
#else
return Array.Empty<T>();
#endif
}
/// <summary>
@@ -124,7 +128,11 @@ namespace Markdig.Syntax
}
else
{
#if NET452
return new T[0];
#else
return Array.Empty<T>();
#endif
}
}