Replace MarkdownSharp with Markdig

This commit is contained in:
Caelan Sayler
2024-01-26 14:44:33 +00:00
parent 278d63df54
commit eb410e9b07
3 changed files with 4 additions and 1729 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,7 @@ using Velopack.Compression;
using Velopack.NuGet;
using Velopack.Packaging.Exceptions;
using Velopack.Packaging.Abstractions;
using Markdig;
namespace Velopack.Packaging
{
@@ -180,9 +181,10 @@ namespace Velopack.Packaging
string releaseNotesText = "";
if (!String.IsNullOrEmpty(releaseNotes)) {
var markdown = File.ReadAllText(releaseNotes);
var html = Markdown.ToHtml(markdown);
releaseNotesText = $"""
<releaseNotes>{SecurityElement.Escape(markdown)}</releaseNotes>
<releaseNotesHtml><![CDATA[{"\n"}{new Markdown().Transform(markdown)}{"\n"}]]></releaseNotesHtml>
<releaseNotesHtml><![CDATA[{"\n"}{html}{"\n"}]]></releaseNotesHtml>
""";
}

View File

@@ -13,6 +13,7 @@
<ItemGroup>
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="Markdig" Version="0.34.0" />
</ItemGroup>
</Project>