Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 7.0.1.9 #471

Merged
merged 19 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c6f831b
Merge pull request #459 from baynezy/master
baynezy Aug 15, 2024
6a004de
Bump HtmlAgilityPack from 1.11.63 to 1.11.64
dependabot[bot] Aug 20, 2024
39106f6
Bump NUnit from 4.1.0 to 4.2.0
dependabot[bot] Aug 23, 2024
7c2f893
Add capability to add custom replacer to scheme
baynezy Aug 23, 2024
7e0cdac
Docs
baynezy Aug 23, 2024
f184308
Merge pull request #462 from baynezy/dependabot/nuget/NUnit-4.2.0
baynezy Aug 23, 2024
62e7849
Merge pull request #460 from baynezy/dependabot/nuget/HtmlAgilityPack…
baynezy Aug 23, 2024
8119331
Bump Microsoft.NET.Test.Sdk from 17.10.0 to 17.11.0
dependabot[bot] Aug 23, 2024
977eff8
Merge pull request #464 from baynezy/feature/issue-463-extend
baynezy Aug 23, 2024
48a6827
Merge pull request #461 from baynezy/dependabot/nuget/Microsoft.NET.T…
baynezy Aug 23, 2024
e0828c7
Bump NUnit from 4.2.0 to 4.2.1
dependabot[bot] Aug 26, 2024
09129b9
Merge pull request #465 from baynezy/dependabot/nuget/NUnit-4.2.1
baynezy Aug 27, 2024
5884753
Bump Verify.NUnit from 26.2.0 to 26.3.0
dependabot[bot] Sep 2, 2024
57c882a
Bump HtmlAgilityPack from 1.11.64 to 1.11.65
dependabot[bot] Sep 2, 2024
e676e32
Bump Microsoft.NET.Test.Sdk from 17.11.0 to 17.11.1
dependabot[bot] Sep 6, 2024
ffdace8
Merge pull request #469 from baynezy/dependabot/nuget/Microsoft.NET.T…
baynezy Sep 6, 2024
f119b19
Merge pull request #468 from baynezy/dependabot/nuget/HtmlAgilityPack…
baynezy Sep 6, 2024
2806c7d
Merge pull request #467 from baynezy/dependabot/nuget/Verify.NUnit-26…
baynezy Sep 6, 2024
c8b45f8
Prepare release 7.0.1.9
Sep 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [7.0.1.9] - 2024-09-06

### Added

- Added support extending existing Schemes for customisation

## [7.0.0.8] - 2024-08-15

### Added
Expand Down Expand Up @@ -485,7 +491,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.0.1] - 2013-07-04

[unreleased]: https://github.com/baynezy/Html2Markdown/compare/7.0.0.8...HEAD
[unreleased]: https://github.com/baynezy/Html2Markdown/compare/7.0.1.9...HEAD
[7.0.1.9]: https://github.com/baynezy/Html2Markdown/compare/7.0.0.8...7.0.1.9
[7.0.0.8]: https://github.com/baynezy/Html2Markdown/compare/6.2.5.7...7.0.0.8
[6.2.5.7]: https://github.com/baynezy/Html2Markdown/compare/6.2.4.6...6.2.5.7
[6.2.4.6]: https://github.com/baynezy/Html2Markdown/compare/6.2.3.6...6.2.4.6
Expand Down
2 changes: 1 addition & 1 deletion semver.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"major":"7","minor":"0","patch":"0","build":"8"}
{"major":"7","minor":"0","patch":"1","build":"9"}
2 changes: 1 addition & 1 deletion src/Html2Markdown/Html2Markdown.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.63" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.65" />
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" />
</ItemGroup>

Expand Down
11 changes: 10 additions & 1 deletion src/Html2Markdown/Scheme/AbstractScheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Html2Markdown.Scheme;
/// A group of IReplacer to deal with converting HTML entities.
/// </summary>
public abstract class AbstractScheme : IScheme {

/// <summary>
/// The collection of IReplacer instances used for replacements.
/// </summary>
Expand All @@ -30,4 +30,13 @@ public IList<IReplacer> Replacers()
{
return ReplacerCollection;
}

/// <summary>
/// Adds a single replacer to the collection.
/// </summary>
/// <param name="replacer">The replacer to add.</param>
public void AddReplacer(IReplacer replacer)
{
ReplacerCollection.Add(replacer);
}
}
6 changes: 3 additions & 3 deletions test/Html2Markdown.Test/Html2Markdown.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

<ItemGroup>
<PackageReference Include="JunitXml.TestLogger" Version="4.0.254" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="4.2.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="Verify.NUnit" Version="26.2.0" />
<PackageReference Include="Verify.NUnit" Version="26.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
106 changes: 106 additions & 0 deletions test/Html2Markdown.Test/Scheme/AbstractSchemeTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
using System.Collections.Generic;
using Html2Markdown.Replacement;
using Html2Markdown.Scheme;

namespace Html2Markdown.Test.Scheme;

public class AbstractSchemeTests
{
[Test]
public void Replacers_WhenCalled_ReturnsReplacerCollection()
{
// arrange
const int expectedCount = 1;
var scheme = new TestScheme();

// act
var replacers = scheme.Replacers();

// assert
Assert.That(replacers.Count, Is.EqualTo(expectedCount));
}

[Test]
public void Replacers_WhenCalled_ReturnsReplacerCollectionWithTestReplacer()
{
// arrange
var scheme = new TestScheme();

// act
var replacers = scheme.Replacers();

// assert
Assert.That(replacers[0], Is.InstanceOf<TestReplacer>());
}

[Test]
public void Replacers_WhenCalled_ReturnsReplacerCollectionWithTestReplacerReplaceMethod()
{
// arrange
const string expected = "test";
var scheme = new TestScheme();

// act
var replacers = scheme.Replacers();
var result = replacers[0].Replace(string.Empty);

// assert
Assert.That(result, Is.EqualTo(expected));
}

[Test]
public void AddReplacer_WhenCalled_AddsReplacerToReplacerCollection()
{
// arrange
const int expectedCount = 2;
var scheme = new TestScheme();

// act
scheme.AddReplacer(new TestReplacer());
var replacers = scheme.Replacers();

// assert
Assert.That(replacers.Count, Is.EqualTo(expectedCount));
}

[Test]
public void AddReplacer_WhenCalled_AddsReplacerToReplacerCollectionWithTestReplacer()
{
// arrange
var scheme = new TestScheme();

// act
scheme.AddReplacer(new TestReplacer());
var replacers = scheme.Replacers();

// assert
Assert.That(replacers[1], Is.InstanceOf<TestReplacer>());
}
}

public class TestScheme : AbstractScheme
{
public TestScheme()
{
AddReplacementGroup(ReplacerCollection, new TestReplacementGroup());
}
}

public class TestReplacementGroup : IReplacementGroup
{
public IEnumerable<IReplacer> Replacers()
{
return new List<IReplacer>
{
new TestReplacer()
};
}
}

public class TestReplacer : IReplacer
{
public string Replace(string html)
{
return "test";
}
}
Loading