Improve markdown parsing to make it less volatile

Fixes #18, #20, #40
This commit is contained in:
Alexey Golub
2018-04-08 12:29:38 +03:00
parent 7ffb799136
commit 7b67cbc385
6 changed files with 323 additions and 279 deletions

View File

@@ -4,14 +4,13 @@ using System.Resources;
namespace DiscordChatExporter.Core.Internal
{
internal static class AssemblyHelper
internal static class Extensions
{
public static string GetResourceString(string resourcePath)
public static string GetManifestResourceString(this Assembly assembly, string resourceName)
{
var assembly = Assembly.GetExecutingAssembly();
var stream = assembly.GetManifestResourceStream(resourcePath);
var stream = assembly.GetManifestResourceStream(resourceName);
if (stream == null)
throw new MissingManifestResourceException($"Could not find resource [{resourcePath}].");
throw new MissingManifestResourceException($"Could not find resource [{resourceName}].");
using (stream)
using (var reader = new StreamReader(stream))