Skip to content

Commit a5bd766

Browse files
authored
Merge pull request #4 from BigBang1112/dev
0.2.1
2 parents b775ced + 4f0a624 commit a5bd766

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ jobs:
5353
thresholds: '60 80'
5454

5555
- name: Publish the package to nuget.org
56-
run: dotnet nuget push MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
56+
run: dotnet nuget push MinimalXmlReader/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
5757

5858
- name: Publish the package to github.com
59-
run: dotnet nuget push MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bigbang1112/index.json
59+
run: dotnet nuget push MinimalXmlReader/bin/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bigbang1112/index.json
6060

6161
- name: Upload the package to this release
62-
run: gh release upload ${{ github.ref_name }} MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg
62+
run: gh release upload ${{ github.ref_name }} MinimalXmlReader/bin/Release/*.nupkg
6363

6464
- name: Set release information
6565
run: gh release edit ${{ github.ref_name }} -n "$(echo -e '${{ github.event.release.body }}\n\nAssets were automatically generated using the [publish workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).')"

MinimalXmlReader/MiniXmlReader.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ public bool ReadContentAsBoolean()
354354
};
355355
}
356356

357+
/// <summary>
358+
/// Consumer of this method should handle safe position.
359+
/// </summary>
357360
/// <exception cref="Exception">Something unexpected has failed.</exception>
358361
private bool ValidateElementName(ReadOnlySpan<char> name)
359362
{
@@ -418,6 +421,9 @@ private Dictionary<string, string> ReadAttributes(bool expectsProcessingInstruct
418421
return attributes;
419422
}
420423

424+
/// <summary>
425+
/// Consumer of this method should handle safe position.
426+
/// </summary>
421427
/// <exception cref="Exception">Something unexpected has failed.</exception>
422428
private bool TryBeginReadStartElement(out ReadOnlySpan<char> name)
423429
{
@@ -429,6 +435,12 @@ private bool TryBeginReadStartElement(out ReadOnlySpan<char> name)
429435
return false;
430436
}
431437

438+
if (xml[position] == '/')
439+
{
440+
name = default;
441+
return false;
442+
}
443+
432444
var start = position;
433445

434446
while (true)

MinimalXmlReader/MinimalXmlReader.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<PackageId>MinimalXmlReader</PackageId>
5-
<Version>0.2.0</Version>
5+
<Version>0.2.1</Version>
66
<Authors>BigBang1112</Authors>
77
<Description>Simple, lightweight, and fast XML reader for .NET, mainly viable for NativeAOT, and for those that don't want to waste 6MB of executable binary just to read a few XML lines.</Description>
88
<Copyright>Copyright (c) 2024 Petr Pivoňka</Copyright>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Nuget](https://img.shields.io/nuget/v/MinimalXmlReader?style=for-the-badge)](https://www.nuget.org/packages/MinimalXmlReader/)
44
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/BigBang1112/minimal-xmlreader?include_prereleases&style=for-the-badge)](https://github.com/BigBang1112/minimal-xmlreader/releases)
5-
[![Code Coverage](https://img.shields.io/badge/Code%20Coverage-61%25-yellow?style=for-the-badge)](https://github.com/BigBang1112/minimal-xmlreader)
5+
[![Code Coverage](https://img.shields.io/badge/Code%20Coverage-60%25-yellow?style=for-the-badge)](https://github.com/BigBang1112/minimal-xmlreader)
66

77
Minimal XmlReader is a simple, lightweight, and fast XML reader for .NET, mainly viable for NativeAOT.
88

0 commit comments

Comments
 (0)