diff --git a/DiscordChatExporter/Services/ExportService.cs b/DiscordChatExporter/Services/ExportService.cs index 1810a138..dd714323 100644 --- a/DiscordChatExporter/Services/ExportService.cs +++ b/DiscordChatExporter/Services/ExportService.cs @@ -220,28 +220,31 @@ namespace DiscordChatExporter.Services // Encode HTML content = HtmlEncode(content); - // Preformatted div + // Pre multiline (```text```) content = Regex.Replace(content, "```+(?:[^`]*?\\n)?([^`]+)\\n?```+", m => "
" + m.Groups[1].Value + "
"); - // Preformatted span + // Pre inline (`text`) content = Regex.Replace(content, "`([^`]+)`", m => "" + m.Groups[1].Value + ""); - // Links from URLs + // URL links content = Regex.Replace(content, "((https?|ftp)://[^\\s/$.?#].[^\\s]*)", "$1"); - // Bold + // Bold (**text**) content = Regex.Replace(content, "\\*\\*([^\\*]*?)\\*\\*", "$1"); - // Italic + // Italic (*text*) content = Regex.Replace(content, "\\*([^\\*]*?)\\*", "$1"); - // Underline + // Underline (__text__) content = Regex.Replace(content, "__([^_]*?)__", "$1"); - // Strike through + // Italic (_text_) + content = Regex.Replace(content, "_([^_]*?)_", "$1"); + + // Strike through (~~text~~) content = Regex.Replace(content, "~~([^~]*?)~~", "$1"); // New lines