Skip to content

Commit db867de

Browse files
committed
Bring back net45 target
1 parent 4f7ef61 commit db867de

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

src/Markdig.Tests/Markdig.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>net452;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
55
<OutputType>Library</OutputType>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

src/Markdig/Markdig.targets

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<NeutralLanguage>en-US</NeutralLanguage>
77
<VersionPrefix>0.20.0</VersionPrefix>
88
<Authors>Alexandre Mutel</Authors>
9-
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
9+
<TargetFrameworks>net452;netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
1010
<PackageTags>Markdown CommonMark md html md2html</PackageTags>
1111
<PackageReleaseNotes>https://github.com/lunet-io/markdig/blob/master/changelog.md</PackageReleaseNotes>
1212
<PackageLicenseExpression>BSD-2-Clause</PackageLicenseExpression>
@@ -20,6 +20,10 @@
2020
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2121
</PropertyGroup>
2222

23+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
24+
<PackageReference Include="System.Memory" Version="4.5.4" />
25+
</ItemGroup>
26+
2327
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
2428
<PackageReference Include="System.Memory" Version="4.5.4" />
2529
</ItemGroup>

src/Markdig/Syntax/ContainerBlock.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ public abstract class ContainerBlock : Block, IList<Block>, IReadOnlyList<Block>
2727
/// <param name="parser">The parser used to create this block.</param>
2828
protected ContainerBlock(BlockParser parser) : base(parser)
2929
{
30+
#if NET452
31+
children = new Block[0];
32+
#else
3033
children = Array.Empty<Block>();
34+
#endif
3135
}
3236

3337
/// <summary>

src/Markdig/Syntax/Inlines/ContainerInline.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ public IEnumerable<T> FindDescendants<T>() where T : Inline
9999
{
100100
if (FirstChild is null)
101101
{
102+
#if NET452
103+
return new T[0];
104+
#else
102105
return Array.Empty<T>();
106+
#endif
103107
}
104108
else
105109
{

src/Markdig/Syntax/MarkdownObjectExtensions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ public static IEnumerable<T> Descendants<T>(this MarkdownObject markdownObject)
9494
}
9595
}
9696

97+
#if NET452
98+
return new T[0];
99+
#else
97100
return Array.Empty<T>();
101+
#endif
98102
}
99103

100104
/// <summary>
@@ -124,7 +128,11 @@ public static IEnumerable<T> Descendants<T>(this ContainerBlock block) where T :
124128
}
125129
else
126130
{
131+
#if NET452
132+
return new T[0];
133+
#else
127134
return Array.Empty<T>();
135+
#endif
128136
}
129137
}
130138

0 commit comments

Comments
 (0)