From 7b32101517dad00b1f4e886a370f6d148a06750a Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Sun, 15 Sep 2019 15:47:34 +0300 Subject: [PATCH] [HTML] Fix incorrect extraction for linked message ID when used in guild and not in DM --- DiscordChatExporter.Core.Rendering/HtmlChatLogRenderer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DiscordChatExporter.Core.Rendering/HtmlChatLogRenderer.cs b/DiscordChatExporter.Core.Rendering/HtmlChatLogRenderer.cs index 38fbd6e..e8d2875 100644 --- a/DiscordChatExporter.Core.Rendering/HtmlChatLogRenderer.cs +++ b/DiscordChatExporter.Core.Rendering/HtmlChatLogRenderer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.IO; @@ -147,7 +147,7 @@ namespace DiscordChatExporter.Core.Rendering if (node is LinkNode linkNode) { // Extract message ID if the link points to a Discord message - var linkedMessageId = Regex.Match(linkNode.Url, "//discordapp.com/channels/[^/]+/\\d+/(\\d+)").Groups[1].Value; + var linkedMessageId = Regex.Match(linkNode.Url, "^https?://discordapp.com/channels/.*?/(\\d+)/?$").Groups[1].Value; return linkedMessageId.IsNullOrWhiteSpace() ? $"{HtmlEncode(linkNode.Title)}"