Skip to content

Commit 78587eb

Browse files
committed
Modified the handling of markdown links to now use Markdig
1 parent f6d96ef commit 78587eb

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

Fritz.Chatbot/Helpers/StringExtensions.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,10 @@ namespace Fritz.Chatbot.Helpers
77
{
88
public static class StringExtensions
99
{
10-
// private readonly static Regex _regex = new Regex(@"\[([\w\s?.-]+)\]\(((?:http:\/\/(www\.)?|https:\/\/(www\.)?|http:\/\/|https:\/\/)?[a-z0-9]+(?:[\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(?:[0-9]{1,5})?(?:\/.*)?)\)");
10+
1111
public static string HandleMarkdownLinks(this string value)
1212
{
1313

14-
//foreach (Match match in _regex.Matches(value))
15-
//{
16-
17-
// var title = match.Groups[1]; // The link text (that between the [] in markdown)
18-
// var url = match.Groups[2]; // The url (that between the () in markdown)
19-
20-
// value = value.Replace(match.Value, $"{title} found at {url} ").Replace(" ", " ");
21-
22-
//}
23-
2414
value = Markdig.Markdown.ToPlainText(value);
2515

2616
value = value.Replace("\n", " ");

0 commit comments

Comments
 (0)