From 95454eb328f0ad70c268ab21d75dcf8803fa508e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 01:47:49 +0000 Subject: [PATCH 01/17] Bump HtmlAgilityPack from 1.11.55 to 1.11.58 Bumps [HtmlAgilityPack](https://github.com/zzzprojects/html-agility-pack) from 1.11.55 to 1.11.58. - [Release notes](https://github.com/zzzprojects/html-agility-pack/releases) - [Commits](https://github.com/zzzprojects/html-agility-pack/compare/v1.11.55...v1.11.58) --- updated-dependencies: - dependency-name: HtmlAgilityPack dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Html2Markdown/Html2Markdown.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Html2Markdown/Html2Markdown.csproj b/src/Html2Markdown/Html2Markdown.csproj index 7b569e05..ada649bb 100644 --- a/src/Html2Markdown/Html2Markdown.csproj +++ b/src/Html2Markdown/Html2Markdown.csproj @@ -13,7 +13,7 @@ - + From 6f276c2623fc15926f9803697b4632b09ed34b6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:48:42 +0000 Subject: [PATCH 02/17] Bump Verify.NUnit from 22.8.0 to 23.1.0 Bumps [Verify.NUnit](https://github.com/VerifyTests/Verify) from 22.8.0 to 23.1.0. - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/commits/23.1.0) --- updated-dependencies: - dependency-name: Verify.NUnit dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- test/Html2Markdown.Test/Html2Markdown.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Html2Markdown.Test/Html2Markdown.Test.csproj b/test/Html2Markdown.Test/Html2Markdown.Test.csproj index 020f19c4..89257dd5 100644 --- a/test/Html2Markdown.Test/Html2Markdown.Test.csproj +++ b/test/Html2Markdown.Test/Html2Markdown.Test.csproj @@ -9,7 +9,7 @@ - + From c0d11179b49a1ae2825afdbae6e70e60f81c7d94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 01:39:46 +0000 Subject: [PATCH 03/17] Bump cake-build/cake-action from 1 to 2 Bumps [cake-build/cake-action](https://github.com/cake-build/cake-action) from 1 to 2. - [Release notes](https://github.com/cake-build/cake-action/releases) - [Commits](https://github.com/cake-build/cake-action/compare/v1...v2) --- updated-dependencies: - dependency-name: cake-build/cake-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/step-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/step-build.yml b/.github/workflows/step-build.yml index 46cbe43a..d9b75563 100644 --- a/.github/workflows/step-build.yml +++ b/.github/workflows/step-build.yml @@ -26,17 +26,17 @@ jobs: with: dotnet-version: 8.0.x - name: Restore - uses: cake-build/cake-action@v1 + uses: cake-build/cake-action@v2 with: target: Restore - name: Build - uses: cake-build/cake-action@v1 + uses: cake-build/cake-action@v2 with: target: Build arguments: | versionNumber: ${{inputs.version}} - name: Run tests - uses: cake-build/cake-action@v1 + uses: cake-build/cake-action@v2 env: TestPath: /home/runner/work/Html2Markdown/Html2Markdown/test/Html2Markdown.Test/Files/ with: @@ -47,7 +47,7 @@ jobs: with: files: "**/TestResults/*.xml" - name: Build NuGet Package - uses: cake-build/cake-action@v1 + uses: cake-build/cake-action@v2 with: target: Pack arguments: | From e12759f9cae0d8871f4d8a9d0c35a8ff51eea132 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 02:00:51 +0000 Subject: [PATCH 04/17] Bump Microsoft.NET.Test.Sdk from 17.8.0 to 17.9.0 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.8.0 to 17.9.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.8.0...v17.9.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- test/Html2Markdown.Test/Html2Markdown.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Html2Markdown.Test/Html2Markdown.Test.csproj b/test/Html2Markdown.Test/Html2Markdown.Test.csproj index 020f19c4..568aaded 100644 --- a/test/Html2Markdown.Test/Html2Markdown.Test.csproj +++ b/test/Html2Markdown.Test/Html2Markdown.Test.csproj @@ -6,7 +6,7 @@ - + From c1bf19bddf0e4151433460df61e3f2f09af7bfa1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 01:56:20 +0000 Subject: [PATCH 05/17] Bump JunitXml.TestLogger from 3.0.134 to 3.1.12 Bumps [JunitXml.TestLogger](https://github.com/spekt/junit.testlogger) from 3.0.134 to 3.1.12. - [Release notes](https://github.com/spekt/junit.testlogger/releases) - [Changelog](https://github.com/spekt/junit.testlogger/blob/master/CHANGELOG.md) - [Commits](https://github.com/spekt/junit.testlogger/compare/v3.0.134...v3.1.12) --- updated-dependencies: - dependency-name: JunitXml.TestLogger dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- test/Html2Markdown.Test/Html2Markdown.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Html2Markdown.Test/Html2Markdown.Test.csproj b/test/Html2Markdown.Test/Html2Markdown.Test.csproj index a5bc9a9d..2dca9d15 100644 --- a/test/Html2Markdown.Test/Html2Markdown.Test.csproj +++ b/test/Html2Markdown.Test/Html2Markdown.Test.csproj @@ -5,7 +5,7 @@ - + From 7608850be63160da08919c599c7bbec6088c6d1d Mon Sep 17 00:00:00 2001 From: Simon Baynes Date: Mon, 12 Feb 2024 18:51:20 +0000 Subject: [PATCH 06/17] Fix sonar recommendations Closes #383 --- .idea/.idea.Html2Markdown/.idea/sonarlint.xml | 8 ++++++++ .../6/7/67b930d18dec91a33af163b768de668916419abe | 0 .../7/4/74fc7b790e5b95a61f3f2942ea2a8eec781a2be0 | 0 .../.idea/sonarlint/issuestore/index.pb | 5 +++++ .../6/7/67b930d18dec91a33af163b768de668916419abe | 0 .../7/4/74fc7b790e5b95a61f3f2942ea2a8eec781a2be0 | 0 .../.idea/sonarlint/securityhotspotstore/index.pb | 5 +++++ src/Html2Markdown/Replacement/HtmlParser.cs | 8 +++++--- src/Html2Markdown/Replacement/PatternReplacer.cs | 3 ++- 9 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .idea/.idea.Html2Markdown/.idea/sonarlint.xml create mode 100644 .idea/.idea.Html2Markdown/.idea/sonarlint/issuestore/6/7/67b930d18dec91a33af163b768de668916419abe create mode 100644 .idea/.idea.Html2Markdown/.idea/sonarlint/issuestore/7/4/74fc7b790e5b95a61f3f2942ea2a8eec781a2be0 create mode 100644 .idea/.idea.Html2Markdown/.idea/sonarlint/issuestore/index.pb create mode 100644 .idea/.idea.Html2Markdown/.idea/sonarlint/securityhotspotstore/6/7/67b930d18dec91a33af163b768de668916419abe create mode 100644 .idea/.idea.Html2Markdown/.idea/sonarlint/securityhotspotstore/7/4/74fc7b790e5b95a61f3f2942ea2a8eec781a2be0 create mode 100644 .idea/.idea.Html2Markdown/.idea/sonarlint/securityhotspotstore/index.pb diff --git a/.idea/.idea.Html2Markdown/.idea/sonarlint.xml b/.idea/.idea.Html2Markdown/.idea/sonarlint.xml new file mode 100644 index 00000000..f0b33da7 --- /dev/null +++ b/.idea/.idea.Html2Markdown/.idea/sonarlint.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/.idea/.idea.Html2Markdown/.idea/sonarlint/issuestore/6/7/67b930d18dec91a33af163b768de668916419abe b/.idea/.idea.Html2Markdown/.idea/sonarlint/issuestore/6/7/67b930d18dec91a33af163b768de668916419abe new file mode 100644 index 00000000..e69de29b diff --git a/.idea/.idea.Html2Markdown/.idea/sonarlint/issuestore/7/4/74fc7b790e5b95a61f3f2942ea2a8eec781a2be0 b/.idea/.idea.Html2Markdown/.idea/sonarlint/issuestore/7/4/74fc7b790e5b95a61f3f2942ea2a8eec781a2be0 new file mode 100644 index 00000000..e69de29b diff --git a/.idea/.idea.Html2Markdown/.idea/sonarlint/issuestore/index.pb b/.idea/.idea.Html2Markdown/.idea/sonarlint/issuestore/index.pb new file mode 100644 index 00000000..2bef50e4 --- /dev/null +++ b/.idea/.idea.Html2Markdown/.idea/sonarlint/issuestore/index.pb @@ -0,0 +1,5 @@ + +[ ++src/Html2Markdown/Replacement/HtmlParser.cs,6\7\67b930d18dec91a33af163b768de668916419abe +` +0src/Html2Markdown/Replacement/PatternReplacer.cs,7\4\74fc7b790e5b95a61f3f2942ea2a8eec781a2be0 \ No newline at end of file diff --git a/.idea/.idea.Html2Markdown/.idea/sonarlint/securityhotspotstore/6/7/67b930d18dec91a33af163b768de668916419abe b/.idea/.idea.Html2Markdown/.idea/sonarlint/securityhotspotstore/6/7/67b930d18dec91a33af163b768de668916419abe new file mode 100644 index 00000000..e69de29b diff --git a/.idea/.idea.Html2Markdown/.idea/sonarlint/securityhotspotstore/7/4/74fc7b790e5b95a61f3f2942ea2a8eec781a2be0 b/.idea/.idea.Html2Markdown/.idea/sonarlint/securityhotspotstore/7/4/74fc7b790e5b95a61f3f2942ea2a8eec781a2be0 new file mode 100644 index 00000000..e69de29b diff --git a/.idea/.idea.Html2Markdown/.idea/sonarlint/securityhotspotstore/index.pb b/.idea/.idea.Html2Markdown/.idea/sonarlint/securityhotspotstore/index.pb new file mode 100644 index 00000000..2bef50e4 --- /dev/null +++ b/.idea/.idea.Html2Markdown/.idea/sonarlint/securityhotspotstore/index.pb @@ -0,0 +1,5 @@ + +[ ++src/Html2Markdown/Replacement/HtmlParser.cs,6\7\67b930d18dec91a33af163b768de668916419abe +` +0src/Html2Markdown/Replacement/PatternReplacer.cs,7\4\74fc7b790e5b95a61f3f2942ea2a8eec781a2be0 \ No newline at end of file diff --git a/src/Html2Markdown/Replacement/HtmlParser.cs b/src/Html2Markdown/Replacement/HtmlParser.cs index 93b1f45a..0406335a 100644 --- a/src/Html2Markdown/Replacement/HtmlParser.cs +++ b/src/Html2Markdown/Replacement/HtmlParser.cs @@ -221,9 +221,11 @@ private static string GetSyntaxHighlightLanguage(HtmlNode node) return string.Empty; } - return classAttributeValue.StartsWith("lang") - ? classAttributeValue.Split('-').Last() - : classAttributeValue; + if (!classAttributeValue.StartsWith("lang")) return classAttributeValue; + var split = classAttributeValue.Split('-'); + + return split[^1]; // PERFORMANCE: https://sonarcloud.io/organizations/baynezy/rules?open=csharpsquid%3AS6608&rule_key=csharpsquid%3AS6608 + } internal static string ReplaceBlockquote(string html) diff --git a/src/Html2Markdown/Replacement/PatternReplacer.cs b/src/Html2Markdown/Replacement/PatternReplacer.cs index 0c6e7052..e414b3c5 100644 --- a/src/Html2Markdown/Replacement/PatternReplacer.cs +++ b/src/Html2Markdown/Replacement/PatternReplacer.cs @@ -11,7 +11,8 @@ public class PatternReplacer : IReplacer public string Replacement { get; init; } public string Replace(string html) { - var regex = new Regex(Pattern); + // SECURITY: https://sonarcloud.io/organizations/baynezy/rules?open=csharpsquid%3AS6444&rule_key=csharpsquid%3AS6444 + var regex = new Regex(Pattern, RegexOptions.None, TimeSpan.FromSeconds(1)); return regex.Replace(html, Replacement); } From ac78d23e8faf4ac51b112d5fda501de4503e8eaa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 01:23:11 +0000 Subject: [PATCH 07/17] Bump thomaseizinger/keep-a-changelog-new-release from 1.3.0 to 2.0.0 Bumps [thomaseizinger/keep-a-changelog-new-release](https://github.com/thomaseizinger/keep-a-changelog-new-release) from 1.3.0 to 2.0.0. - [Release notes](https://github.com/thomaseizinger/keep-a-changelog-new-release/releases) - [Changelog](https://github.com/thomaseizinger/keep-a-changelog-new-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/thomaseizinger/keep-a-changelog-new-release/compare/1.3.0...2.0.0) --- updated-dependencies: - dependency-name: thomaseizinger/keep-a-changelog-new-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/branch-hotfix.yml | 2 +- .github/workflows/draft-new-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/branch-hotfix.yml b/.github/workflows/branch-hotfix.yml index 61545841..22e38356 100644 --- a/.github/workflows/branch-hotfix.yml +++ b/.github/workflows/branch-hotfix.yml @@ -49,7 +49,7 @@ jobs: "build": "${{ github.run_number }}" } - name: Update changelog - uses: thomaseizinger/keep-a-changelog-new-release@1.3.0 + uses: thomaseizinger/keep-a-changelog-new-release@2.0.0 with: tag: ${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }} - name: Commit Changes diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 859b2689..66d130c8 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -36,7 +36,7 @@ jobs: } - name: Update changelog - uses: thomaseizinger/keep-a-changelog-new-release@1.3.0 + uses: thomaseizinger/keep-a-changelog-new-release@2.0.0 with: tag: ${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }} From 253599202c89084aab0591c41ea872ec1f246926 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 01:36:36 +0000 Subject: [PATCH 08/17] Bump Verify.NUnit from 23.1.0 to 23.2.0 Bumps [Verify.NUnit](https://github.com/VerifyTests/Verify) from 23.1.0 to 23.2.0. - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/23.1.0...23.2.0) --- updated-dependencies: - dependency-name: Verify.NUnit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- test/Html2Markdown.Test/Html2Markdown.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Html2Markdown.Test/Html2Markdown.Test.csproj b/test/Html2Markdown.Test/Html2Markdown.Test.csproj index a5bc9a9d..5547f8c2 100644 --- a/test/Html2Markdown.Test/Html2Markdown.Test.csproj +++ b/test/Html2Markdown.Test/Html2Markdown.Test.csproj @@ -9,7 +9,7 @@ - + From e55f675e630a887b87850979ebf819fec55c5fe5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 01:37:05 +0000 Subject: [PATCH 09/17] Bump HtmlAgilityPack from 1.11.58 to 1.11.59 Bumps [HtmlAgilityPack](https://github.com/zzzprojects/html-agility-pack) from 1.11.58 to 1.11.59. - [Release notes](https://github.com/zzzprojects/html-agility-pack/releases) - [Commits](https://github.com/zzzprojects/html-agility-pack/compare/v1.11.58...v1.11.59) --- updated-dependencies: - dependency-name: HtmlAgilityPack dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Html2Markdown/Html2Markdown.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Html2Markdown/Html2Markdown.csproj b/src/Html2Markdown/Html2Markdown.csproj index ada649bb..49260e5e 100644 --- a/src/Html2Markdown/Html2Markdown.csproj +++ b/src/Html2Markdown/Html2Markdown.csproj @@ -13,7 +13,7 @@ - + From c10516132dab0de743464b5be773e23fac3f421f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 01:32:22 +0000 Subject: [PATCH 10/17] Bump Verify.NUnit from 23.2.0 to 23.2.1 Bumps [Verify.NUnit](https://github.com/VerifyTests/Verify) from 23.2.0 to 23.2.1. - [Release notes](https://github.com/VerifyTests/Verify/releases) - [Commits](https://github.com/VerifyTests/Verify/compare/23.2.0...23.2.1) --- updated-dependencies: - dependency-name: Verify.NUnit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- test/Html2Markdown.Test/Html2Markdown.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Html2Markdown.Test/Html2Markdown.Test.csproj b/test/Html2Markdown.Test/Html2Markdown.Test.csproj index 4d1aedd3..d2679d72 100644 --- a/test/Html2Markdown.Test/Html2Markdown.Test.csproj +++ b/test/Html2Markdown.Test/Html2Markdown.Test.csproj @@ -9,7 +9,7 @@ - + From 9473730a8d9efe08a226778223a51fc025c73336 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 01:34:52 +0000 Subject: [PATCH 11/17] Bump NUnit from 4.0.1 to 4.1.0 Bumps [NUnit](https://github.com/nunit/nunit) from 4.0.1 to 4.1.0. - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/master/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/v4.0.1...4.1.0) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- test/Html2Markdown.Test/Html2Markdown.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Html2Markdown.Test/Html2Markdown.Test.csproj b/test/Html2Markdown.Test/Html2Markdown.Test.csproj index 4d1aedd3..a0ad9f0b 100644 --- a/test/Html2Markdown.Test/Html2Markdown.Test.csproj +++ b/test/Html2Markdown.Test/Html2Markdown.Test.csproj @@ -7,7 +7,7 @@ - + From 78a1486254c07b0b7035b689aff78d564483e2a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 01:39:04 +0000 Subject: [PATCH 12/17] Bump thomaseizinger/keep-a-changelog-new-release from 2.0.0 to 3.0.0 Bumps [thomaseizinger/keep-a-changelog-new-release](https://github.com/thomaseizinger/keep-a-changelog-new-release) from 2.0.0 to 3.0.0. - [Release notes](https://github.com/thomaseizinger/keep-a-changelog-new-release/releases) - [Changelog](https://github.com/thomaseizinger/keep-a-changelog-new-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/thomaseizinger/keep-a-changelog-new-release/compare/2.0.0...3.0.0) --- updated-dependencies: - dependency-name: thomaseizinger/keep-a-changelog-new-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/branch-hotfix.yml | 2 +- .github/workflows/draft-new-release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/branch-hotfix.yml b/.github/workflows/branch-hotfix.yml index 22e38356..aca96c84 100644 --- a/.github/workflows/branch-hotfix.yml +++ b/.github/workflows/branch-hotfix.yml @@ -49,7 +49,7 @@ jobs: "build": "${{ github.run_number }}" } - name: Update changelog - uses: thomaseizinger/keep-a-changelog-new-release@2.0.0 + uses: thomaseizinger/keep-a-changelog-new-release@3.0.0 with: tag: ${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }} - name: Commit Changes diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 66d130c8..06de7b5c 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -36,7 +36,7 @@ jobs: } - name: Update changelog - uses: thomaseizinger/keep-a-changelog-new-release@2.0.0 + uses: thomaseizinger/keep-a-changelog-new-release@3.0.0 with: tag: ${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }} From 3522036d309faef2791fd0ad430074ad32ee66a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 01:54:49 +0000 Subject: [PATCH 13/17] Bump RadovanPelka/github-action-json from 1.0.1 to 1.0.2 Bumps [RadovanPelka/github-action-json](https://github.com/radovanpelka/github-action-json) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/radovanpelka/github-action-json/releases) - [Commits](https://github.com/radovanpelka/github-action-json/compare/v1.0.1...v1.0.2) --- updated-dependencies: - dependency-name: RadovanPelka/github-action-json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/branch-hotfix.yml | 2 +- .github/workflows/draft-new-release.yml | 2 +- .github/workflows/step-version.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/branch-hotfix.yml b/.github/workflows/branch-hotfix.yml index 22e38356..935bae4b 100644 --- a/.github/workflows/branch-hotfix.yml +++ b/.github/workflows/branch-hotfix.yml @@ -38,7 +38,7 @@ jobs: run: | echo "patch_version=$(($(cat semver.json | jq -r '.patch')+1))" > $GITHUB_OUTPUT - name: Store New Version - uses: RadovanPelka/github-action-json@v1.0.1 + uses: RadovanPelka/github-action-json@v1.0.2 with: path: semver.json replaceWith: | diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 66d130c8..69298db7 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -24,7 +24,7 @@ jobs: run: git checkout -b release/${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }} - name: Update Version Number - uses: RadovanPelka/github-action-json@v1.0.1 + uses: RadovanPelka/github-action-json@v1.0.2 with: path: semver.json replaceWith: | diff --git a/.github/workflows/step-version.yml b/.github/workflows/step-version.yml index 3e4de85f..94d1f635 100644 --- a/.github/workflows/step-version.yml +++ b/.github/workflows/step-version.yml @@ -42,7 +42,7 @@ jobs: uses: actions/checkout@v4 - name: Get Version id: get-version - uses: RadovanPelka/github-action-json@v1.0.1 + uses: RadovanPelka/github-action-json@v1.0.2 with: path: 'semver.json' - id: set-version From e3cd1ec6b04571651a3ac4e308f472d6d5798239 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 01:16:11 +0000 Subject: [PATCH 14/17] Bump HtmlAgilityPack from 1.11.59 to 1.11.61 Bumps [HtmlAgilityPack](https://github.com/zzzprojects/html-agility-pack) from 1.11.59 to 1.11.61. - [Release notes](https://github.com/zzzprojects/html-agility-pack/releases) - [Commits](https://github.com/zzzprojects/html-agility-pack/compare/v1.11.59...v1.11.61) --- updated-dependencies: - dependency-name: HtmlAgilityPack dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Html2Markdown/Html2Markdown.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Html2Markdown/Html2Markdown.csproj b/src/Html2Markdown/Html2Markdown.csproj index 49260e5e..aafe5fdc 100644 --- a/src/Html2Markdown/Html2Markdown.csproj +++ b/src/Html2Markdown/Html2Markdown.csproj @@ -13,7 +13,7 @@ - + From ecd1296d0c3118edc60c71891bfeddd31719acdf Mon Sep 17 00:00:00 2001 From: Simon Baynes Date: Tue, 7 May 2024 09:45:17 +0100 Subject: [PATCH 15/17] Replace version management to AfterLife solution Closes #396 --- .github/workflows/branch-hotfix.yml | 13 +++++-------- .github/workflows/draft-new-release.yml | 13 +++++-------- .github/workflows/step-version.yml | 2 +- .idea/.idea.Html2Markdown/.idea/indexLayout.xml | 4 +++- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/branch-hotfix.yml b/.github/workflows/branch-hotfix.yml index 91c9ae09..f762301c 100644 --- a/.github/workflows/branch-hotfix.yml +++ b/.github/workflows/branch-hotfix.yml @@ -38,16 +38,13 @@ jobs: run: | echo "patch_version=$(($(cat semver.json | jq -r '.patch')+1))" > $GITHUB_OUTPUT - name: Store New Version - uses: RadovanPelka/github-action-json@v1.0.2 + uses: Afterlife-Guide/SemVer.Action@1.0.3.8 with: path: semver.json - replaceWith: | - { - "major": "${{ needs.get-version.outputs.major }}", - "minor": "${{ needs.get-version.outputs.minor }}", - "patch": "${{ steps.increment_version.outputs.patch_version }}", - "build": "${{ github.run_number }}" - } + major-version: ${{ needs.get-version.outputs.major }} + minor-version: ${{ needs.get-version.outputs.minor }} + patch-version: ${{ steps.increment_version.outputs.patch_version }} + build-version: ${{ github.run_number }} - name: Update changelog uses: thomaseizinger/keep-a-changelog-new-release@3.0.0 with: diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 2dc50039..3b5f7540 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -24,16 +24,13 @@ jobs: run: git checkout -b release/${{ github.event.inputs.major_version }}.${{ github.event.inputs.minor_version }}.${{ github.event.inputs.patch_version }}.${{ github.run_number }} - name: Update Version Number - uses: RadovanPelka/github-action-json@v1.0.2 + uses: Afterlife-Guide/SemVer.Action@1.0.3.8 with: path: semver.json - replaceWith: | - { - "major": "${{ github.event.inputs.major_version }}", - "minor": "${{ github.event.inputs.minor_version }}", - "patch": "${{ github.event.inputs.patch_version }}", - "build": "${{ github.run_number }}" - } + major-version: ${{ github.event.inputs.major_version }} + minor-version: ${{ github.event.inputs.minor_version }} + patch-version: ${{ github.event.inputs.patch_version }} + build-version: ${{ github.run_number }} - name: Update changelog uses: thomaseizinger/keep-a-changelog-new-release@3.0.0 diff --git a/.github/workflows/step-version.yml b/.github/workflows/step-version.yml index 94d1f635..94d9fe70 100644 --- a/.github/workflows/step-version.yml +++ b/.github/workflows/step-version.yml @@ -42,7 +42,7 @@ jobs: uses: actions/checkout@v4 - name: Get Version id: get-version - uses: RadovanPelka/github-action-json@v1.0.2 + uses: Afterlife-Guide/SemVer.Action@1.0.3.8 with: path: 'semver.json' - id: set-version diff --git a/.idea/.idea.Html2Markdown/.idea/indexLayout.xml b/.idea/.idea.Html2Markdown/.idea/indexLayout.xml index 7b08163c..1ead36c7 100644 --- a/.idea/.idea.Html2Markdown/.idea/indexLayout.xml +++ b/.idea/.idea.Html2Markdown/.idea/indexLayout.xml @@ -1,7 +1,9 @@ - + + .github + From a9703875571076510773fe6e31371c4bafd1914b Mon Sep 17 00:00:00 2001 From: Simon Baynes Date: Tue, 7 May 2024 11:49:39 +0100 Subject: [PATCH 16/17] Fix issue with additional empty lists breaking Closes #395 --- src/Html2Markdown/Replacement/HtmlParser.cs | 16 +++++++++++++--- ...sts_ThenReplaceWithMarkdownLists.verified.txt | 1 + ...sts_ThenReplaceWithMarkdownLists.verified.txt | 1 + .../MarkdownSchemeConverterTest.cs | 9 +++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 test/Html2Markdown.Test/CommonMarkSchemeConverterTest.Convert_WhenThereAreMultipleUnorderedLists_ThenReplaceWithMarkdownLists.verified.txt create mode 100644 test/Html2Markdown.Test/MarkdownSchemeConverterTest.Convert_WhenThereAreMultipleUnorderedLists_ThenReplaceWithMarkdownLists.verified.txt diff --git a/src/Html2Markdown/Replacement/HtmlParser.cs b/src/Html2Markdown/Replacement/HtmlParser.cs index 0406335a..f5ee4853 100644 --- a/src/Html2Markdown/Replacement/HtmlParser.cs +++ b/src/Html2Markdown/Replacement/HtmlParser.cs @@ -6,15 +6,25 @@ namespace Html2Markdown.Replacement; internal static partial class HtmlParser { - private static readonly Regex NoChildren = HtmlListHasNoChildren(); internal static string ReplaceLists(string html) { var finalHtml = html; + var lastRun = string.Empty; while (HasNoChildLists(finalHtml)) { - var listToReplace = NoChildren.Match(finalHtml).Value; + var listToReplace = HtmlListHasNoChildren().Match(finalHtml).Value; var formattedList = ReplaceList(listToReplace); + + // an empty signifies that the HTML is malformed in some way. + // so we should leave the final HTML as is + if (string.IsNullOrEmpty(formattedList)) { + finalHtml = finalHtml.Replace(listToReplace, lastRun); + break; + } + + lastRun = formattedList; + finalHtml = finalHtml.Replace(listToReplace, formattedList); } @@ -75,7 +85,7 @@ private static bool ListOnlyHasEmptyStringsForChildren(IEnumerable listI private static bool HasNoChildLists(string html) { - return NoChildren.Match(html).Success; + return HtmlListHasNoChildren().Match(html).Success; } internal static string ReplacePre(string html) diff --git a/test/Html2Markdown.Test/CommonMarkSchemeConverterTest.Convert_WhenThereAreMultipleUnorderedLists_ThenReplaceWithMarkdownLists.verified.txt b/test/Html2Markdown.Test/CommonMarkSchemeConverterTest.Convert_WhenThereAreMultipleUnorderedLists_ThenReplaceWithMarkdownLists.verified.txt new file mode 100644 index 00000000..465eee9d --- /dev/null +++ b/test/Html2Markdown.Test/CommonMarkSchemeConverterTest.Convert_WhenThereAreMultipleUnorderedLists_ThenReplaceWithMarkdownLists.verified.txt @@ -0,0 +1 @@ +* first list val \ No newline at end of file diff --git a/test/Html2Markdown.Test/MarkdownSchemeConverterTest.Convert_WhenThereAreMultipleUnorderedLists_ThenReplaceWithMarkdownLists.verified.txt b/test/Html2Markdown.Test/MarkdownSchemeConverterTest.Convert_WhenThereAreMultipleUnorderedLists_ThenReplaceWithMarkdownLists.verified.txt new file mode 100644 index 00000000..465eee9d --- /dev/null +++ b/test/Html2Markdown.Test/MarkdownSchemeConverterTest.Convert_WhenThereAreMultipleUnorderedLists_ThenReplaceWithMarkdownLists.verified.txt @@ -0,0 +1 @@ +* first list val \ No newline at end of file diff --git a/test/Html2Markdown.Test/MarkdownSchemeConverterTest.cs b/test/Html2Markdown.Test/MarkdownSchemeConverterTest.cs index 5128aaf6..1492d7c4 100644 --- a/test/Html2Markdown.Test/MarkdownSchemeConverterTest.cs +++ b/test/Html2Markdown.Test/MarkdownSchemeConverterTest.cs @@ -633,6 +633,15 @@ public Task Convert_WhenThereIsAMultilineOrderedListWithNestedParagraphsAndCodeE return CheckConversion(html); } + + // See issue https://github.com/baynezy/Html2Markdown/issues/395 + [Test] + public Task Convert_WhenThereAreMultipleUnorderedLists_ThenReplaceWithMarkdownLists() + { + const string html = "
    • first list val
"; + + return CheckConversion(html); + } #endregion From 83ea093427d064449300c5344ad67114d23de9ea Mon Sep 17 00:00:00 2001 From: GitHub Action Bot Date: Tue, 7 May 2024 10:57:52 +0000 Subject: [PATCH 17/17] Prepare release 6.2.1.4 --- CHANGELOG.md | 8 ++++---- semver.json | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d84daf8..2cc7b3be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,16 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [6.2.1.4] - 2024-05-07 + ## [6.2.0.3] - 2023-12-21 ## [6.1.0.2] - 2023-12-11 ## [6.0.0.1] - 2023-12-07 -[Unreleased]: https://github.com/baynezy/Html2Markdown/compare/6.2.0.3...HEAD - +[unreleased]: https://github.com/baynezy/Html2Markdown/compare/6.2.1.4...HEAD +[6.2.1.4]: https://github.com/baynezy/Html2Markdown/compare/6.2.0.3...6.2.1.4 [6.2.0.3]: https://github.com/baynezy/Html2Markdown/compare/6.1.0.2...6.2.0.3 - [6.1.0.2]: https://github.com/baynezy/Html2Markdown/compare/6.0.0.1...6.1.0.2 - [6.0.0.1]: https://github.com/baynezy/Html2Markdown/compare/6dab0aa86b4b6e4f30b64de9990165672639bc61...6.0.0.1 diff --git a/semver.json b/semver.json index 72661eb0..bf021d35 100644 --- a/semver.json +++ b/semver.json @@ -1,6 +1 @@ -{ - "major": "6", - "minor": "2", - "patch": "0", - "build": "3" -} \ No newline at end of file +{"major":"6","minor":"2","patch":"1","build":"4"} \ No newline at end of file