Refactor more

pull/4/head
Alexey Golub 7 years ago
parent 16ac87d9ce
commit 36213c87a8

@ -6,17 +6,17 @@ namespace DiscordChatExporter.Models
{
public class MessageGroup
{
public User Author { get; }
public DateTime FirstTimeStamp { get; }
public IReadOnlyList<Message> Messages { get; }
public MessageGroup(User author, DateTime firstTimeStamp, IEnumerable<Message> messages)
{
Author = author;
FirstTimeStamp = firstTimeStamp;
Messages = messages.ToArray();
}
public User Author { get; }
public DateTime FirstTimeStamp { get; }
public IReadOnlyList<Message> Messages { get; }
}
}

@ -74,10 +74,12 @@ namespace DiscordChatExporter.Services
"<a href=\"$1\">$1</a>");
// Preformatted multiline
content = Regex.Replace(content, "```([^`]*?)```", e => "<span class=\"pre\">" + e.Groups[1].Value + "</span>");
content = Regex.Replace(content, "```([^`]*?)```",
e => "<span class=\"pre\">" + e.Groups[1].Value + "</span>");
// Preformatted
content = Regex.Replace(content, "`([^`]*?)`", e => "<span class=\"pre\">" + e.Groups[1].Value + "</span>");
content = Regex.Replace(content, "`([^`]*?)`",
e => "<span class=\"pre\">" + e.Groups[1].Value + "</span>");
// Bold
content = Regex.Replace(content, "\\*\\*([^\\*]*?)\\*\\*", "<b>$1</b>");

Loading…
Cancel
Save