|
|
@ -218,18 +218,18 @@ namespace DiscordChatExporter.Services
|
|
|
|
// Encode HTML
|
|
|
|
// Encode HTML
|
|
|
|
content = HtmlEncode(content);
|
|
|
|
content = HtmlEncode(content);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Preformatted div
|
|
|
|
|
|
|
|
content = Regex.Replace(content, "```+(?:[^`]*?\\n)?([^`]+)\\n?```+",
|
|
|
|
|
|
|
|
m => "<div class=\"pre\">" + m.Groups[1].Value + "</div>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Preformatted span
|
|
|
|
|
|
|
|
content = Regex.Replace(content, "`([^`]+)`",
|
|
|
|
|
|
|
|
m => "<span class=\"pre\">" + m.Groups[1].Value + "</span>");
|
|
|
|
|
|
|
|
|
|
|
|
// Links from URLs
|
|
|
|
// Links from URLs
|
|
|
|
content = Regex.Replace(content, "((https?|ftp)://[^\\s/$.?#].[^\\s]*)",
|
|
|
|
content = Regex.Replace(content, "((https?|ftp)://[^\\s/$.?#].[^\\s]*)",
|
|
|
|
"<a href=\"$1\">$1</a>");
|
|
|
|
"<a href=\"$1\">$1</a>");
|
|
|
|
|
|
|
|
|
|
|
|
// Preformatted multiline
|
|
|
|
|
|
|
|
content = Regex.Replace(content, "```([^`]*?)```",
|
|
|
|
|
|
|
|
m => "<div class=\"pre\">" + m.Groups[1].Value.Trim('\n') + "</div>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Preformatted inline
|
|
|
|
|
|
|
|
content = Regex.Replace(content, "`([^`]*?)`",
|
|
|
|
|
|
|
|
m => "<span class=\"pre\">" + m.Groups[1].Value + "</span>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Bold
|
|
|
|
// Bold
|
|
|
|
content = Regex.Replace(content, "\\*\\*([^\\*]*?)\\*\\*", "<b>$1</b>");
|
|
|
|
content = Regex.Replace(content, "\\*\\*([^\\*]*?)\\*\\*", "<b>$1</b>");
|
|
|
|
|
|
|
|
|
|
|
|