diff --git a/Form1.cs b/Form1.cs
index 90ed1b9..9f3fb10 100644
--- a/Form1.cs
+++ b/Form1.cs
@@ -1,5 +1,6 @@
using CefSharp;
using CefSharp.WinForms;
+using Markdig;
using System.Linq.Expressions;
namespace MintHTML
@@ -175,72 +176,7 @@ border-width: 1px
// Custom functions
private void convert()
{
- htmlfile = "";
- using (StringReader reader = new StringReader(markfile))
- {
- string line;
- while ((line = reader.ReadLine()) != null)
- {
- try
- {
- // Header 1
- if (line[1..2] == "# ")
- {
- line = "
" + line[1..] + "
";
-
- }
- // Header 2
- else if (line[1..3] == "## ")
- {
- line = "" + line[1..] + "
";
-
- }
- // Header 3
- else if (line[1..4] == "### ")
- {
- line = "" + line[1..] + "
";
-
- }
- // Header 4
- else if (line[1..5] == "#### ")
- {
- line = "" + line[1..] + "
";
-
- }
- // Header 5
- else if (line[1..6] == "##### ")
- {
- line = "" + line[1..] + "
";
-
- }
- // Header 6
- else if (line[1..7] == "###### ")
- {
- line = "" + line[1..] + "
";
-
- }
- // Bullet point
- else if (line[1..2] == "* ")
- {
- line = "" + line[1..] + "";
- }
- else if (line[1..2] == "- ")
- {
- line = "" + line[1..] + "";
- } } catch{}
- // Code block
- if (line.Contains("`"))
- {
- line = "" + line[1..^1] + "
";
- }
- // Everything else (Possibly paragraph or HTML code)
- else
- {
- line = line + "
";
- }
- htmlfile += line;
- }
- }
+ htmlfile = Markdown.ToHtml(markfile);
}
// Custom functions end
diff --git a/MintHTML.csproj b/MintHTML.csproj
index 476e950..14fee09 100644
--- a/MintHTML.csproj
+++ b/MintHTML.csproj
@@ -18,7 +18,16 @@
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file