Replaced CommonMark.Net with MarkdownSharp. Smaller and a single file, so there are no Nuget dependencies.
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Katteker.Gui
|
||||
{
|
||||
internal static class ChangelogHelper
|
||||
{
|
||||
private static string GenerateHtmlifyChangelog(string text, string extension)
|
||||
private static string GenerateChangelogAsHtml(string text, string extension)
|
||||
{
|
||||
string result;
|
||||
switch (extension)
|
||||
@@ -17,7 +17,7 @@ namespace Katteker.Gui
|
||||
result = plainText.Replace(Environment.NewLine, "<br />");
|
||||
break;
|
||||
case ".md":
|
||||
result = CommonMark.CommonMarkConverter.Convert(text);
|
||||
result = new MarkdownSharp.Markdown().Transform(text);
|
||||
break;
|
||||
default:
|
||||
result = text;
|
||||
@@ -39,23 +39,23 @@ namespace Katteker.Gui
|
||||
using (var response = await webReq.GetResponseAsync().ConfigureAwait(false))
|
||||
using (var sr = new StreamReader(response.GetResponseStream()))
|
||||
{
|
||||
return GenerateHtmlifyChangelog(await sr.ReadToEndAsync().ConfigureAwait(false),
|
||||
return GenerateChangelogAsHtml(await sr.ReadToEndAsync().ConfigureAwait(false),
|
||||
Path.GetExtension(filename));
|
||||
}
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
var changelogFilename = Path.GetFileName(filename);
|
||||
if (changelogFilename == null) return GenerateHtmlifyChangelog("Changelog not found", ".txt");
|
||||
if (changelogFilename == null) return GenerateChangelogAsHtml("Changelog not found", ".txt");
|
||||
var currentChangelogPath = Path.Combine(Environment.CurrentDirectory, changelogFilename);
|
||||
if (File.Exists(currentChangelogPath))
|
||||
{
|
||||
return GenerateHtmlifyChangelog(File.ReadAllText(currentChangelogPath), Path.GetExtension(filename));
|
||||
return GenerateChangelogAsHtml(File.ReadAllText(currentChangelogPath), Path.GetExtension(filename));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return GenerateHtmlifyChangelog("Changelog not found", ".txt");
|
||||
return GenerateChangelogAsHtml("Changelog not found", ".txt");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,9 +34,6 @@
|
||||
<DocumentationFile>bin\Release\Katteker.Gui.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CommonMark, Version=0.1.0.0, Culture=neutral, PublicKeyToken=001ef8810438905d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CommonMark.NET.0.15.1\lib\net45\CommonMark.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@@ -46,6 +43,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ChangelogHelper.cs" />
|
||||
<Compile Include="MarkdownSharp.cs" />
|
||||
<Compile Include="Wrapper.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
@@ -62,7 +60,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
|
||||
1779
Katteker.Gui/MarkdownSharp.cs
Normal file
1779
Katteker.Gui/MarkdownSharp.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,5 @@ using System.Runtime.InteropServices;
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyInformationalVersion("1.0.0")]
|
||||
[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0")]
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="CommonMark.NET" version="0.15.1" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user