Skip to content

Commit

Permalink
feat: add .net6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
sun128764 committed Oct 8, 2023
1 parent 285d701 commit 8b51d05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions AssParser.Lib/AssParser.Lib.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
3 changes: 2 additions & 1 deletion AssParser.Lib/AssParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public static async Task<AssSubtitleModel> ParseAssFile(StreamReader assStream)
{
continue;
}
if (tag is not ['[', .., ']'])
//if (tag is not ['[', .., ']']) //.net 7+ only
if (!tag.StartsWith('[') || !tag.EndsWith(']'))
{
throw new AssParserException($"{tag} is not a valid section name", assStream, lineCount, AssParserErrorType.InvalidSection);
}
Expand Down

0 comments on commit 8b51d05

Please sign in to comment.