mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2024-09-19 12:18:48 -04:00
parent
6968f987ce
commit
42d4d64695
1 changed files with 10 additions and 7 deletions
|
@ -220,28 +220,31 @@ namespace DiscordChatExporter.Services
|
|||
// Encode HTML
|
||||
content = HtmlEncode(content);
|
||||
|
||||
// Preformatted div
|
||||
// Pre multiline (```text```)
|
||||
content = Regex.Replace(content, "```+(?:[^`]*?\\n)?([^`]+)\\n?```+",
|
||||
m => "<div class=\"pre\">" + m.Groups[1].Value + "</div>");
|
||||
|
||||
// Preformatted span
|
||||
// Pre inline (`text`)
|
||||
content = Regex.Replace(content, "`([^`]+)`",
|
||||
m => "<span class=\"pre\">" + m.Groups[1].Value + "</span>");
|
||||
|
||||
// Links from URLs
|
||||
// URL links
|
||||
content = Regex.Replace(content, "((https?|ftp)://[^\\s/$.?#].[^\\s]*)",
|
||||
"<a href=\"$1\">$1</a>");
|
||||
|
||||
// Bold
|
||||
// Bold (**text**)
|
||||
content = Regex.Replace(content, "\\*\\*([^\\*]*?)\\*\\*", "<b>$1</b>");
|
||||
|
||||
// Italic
|
||||
// Italic (*text*)
|
||||
content = Regex.Replace(content, "\\*([^\\*]*?)\\*", "<i>$1</i>");
|
||||
|
||||
// Underline
|
||||
// Underline (__text__)
|
||||
content = Regex.Replace(content, "__([^_]*?)__", "<u>$1</u>");
|
||||
|
||||
// Strike through
|
||||
// Italic (_text_)
|
||||
content = Regex.Replace(content, "_([^_]*?)_", "<i>$1</i>");
|
||||
|
||||
// Strike through (~~text~~)
|
||||
content = Regex.Replace(content, "~~([^~]*?)~~", "<s>$1</s>");
|
||||
|
||||
// New lines
|
||||
|
|
Loading…
Reference in a new issue