From f41106783b58e8c0e91bb474cdb18725ac241731 Mon Sep 17 00:00:00 2001 From: James Brundage <@github.com> Date: Fri, 23 Feb 2024 11:27:25 -0800 Subject: [PATCH 1/3] fix: MarkdownInfo.ToString() should be HTML ( Fixes #28 ) --- src/MarkdownConverter.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/MarkdownConverter.cs b/src/MarkdownConverter.cs index bb4a3e8..2587aae 100644 --- a/src/MarkdownConverter.cs +++ b/src/MarkdownConverter.cs @@ -44,6 +44,14 @@ public class MarkdownInfo /// Gets the AST of the Markdown string. /// public Markdig.Syntax.MarkdownDocument Tokens { get; internal set; } + + + /// + /// Gets the converted markdown as a string. + /// + public string ToString() { + return this.Html; + } } /// From 0df32108980e687d4fe87f887c1f95440657a429 Mon Sep 17 00:00:00 2001 From: James Brundage <@github.com> Date: Fri, 23 Feb 2024 13:17:07 -0800 Subject: [PATCH 2/3] fix: MarkdownInfo.ToString() should preferrably be HTML ( Fixes #28 ) If HTML is not present, it should be or VT100EncodedString. --- src/MarkdownConverter.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/MarkdownConverter.cs b/src/MarkdownConverter.cs index 2587aae..10eb3ae 100644 --- a/src/MarkdownConverter.cs +++ b/src/MarkdownConverter.cs @@ -50,7 +50,14 @@ public class MarkdownInfo /// Gets the converted markdown as a string. /// public string ToString() { - return this.Html; + if (! string.IsNullOrEmpty(this.Html)) { + return this.Html; + } else if (! string.IsNullOrEmpty(this.VT100EncodedString)) { + return this.VT100EncodedString; + } else { + return string.Empty; + } + } } From f3dda092227120791c86bbd22353b9102bb7fe21 Mon Sep 17 00:00:00 2001 From: James Brundage <@github.com> Date: Fri, 23 Feb 2024 13:22:50 -0800 Subject: [PATCH 3/3] fix: MarkdownInfo.ToString() should preferrably be HTML ( Fixes #28 ) Overriding --- src/MarkdownConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MarkdownConverter.cs b/src/MarkdownConverter.cs index 10eb3ae..68d9f49 100644 --- a/src/MarkdownConverter.cs +++ b/src/MarkdownConverter.cs @@ -49,7 +49,7 @@ public class MarkdownInfo /// /// Gets the converted markdown as a string. /// - public string ToString() { + public override string ToString() { if (! string.IsNullOrEmpty(this.Html)) { return this.Html; } else if (! string.IsNullOrEmpty(this.VT100EncodedString)) {