From b110413c08e2765578ba7738871b51191f5b663f Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Sat, 30 Sep 2017 17:24:46 +0300 Subject: [PATCH] Fix div.pre output styling --- DiscordChatExporter/Resources/ExportService/DarkTheme.css | 8 +++++++- .../Resources/ExportService/LightTheme.css | 8 +++++++- DiscordChatExporter/Services/ExportService.cs | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/DiscordChatExporter/Resources/ExportService/DarkTheme.css b/DiscordChatExporter/Resources/ExportService/DarkTheme.css index c53e3024..e5e20004 100644 --- a/DiscordChatExporter/Resources/ExportService/DarkTheme.css +++ b/DiscordChatExporter/Resources/ExportService/DarkTheme.css @@ -12,7 +12,13 @@ a { a:hover { text-decoration: underline; } -div.pre, span.pre { +div.pre { + background-color: #2F3136; + font-family: Consolas, Courier New, Courier, Monospace; + padding: 8px; +} + +span.pre { background-color: #2F3136; font-family: Consolas, Courier New, Courier, Monospace; padding-left: 2px; diff --git a/DiscordChatExporter/Resources/ExportService/LightTheme.css b/DiscordChatExporter/Resources/ExportService/LightTheme.css index 4d5ca432..922789ef 100644 --- a/DiscordChatExporter/Resources/ExportService/LightTheme.css +++ b/DiscordChatExporter/Resources/ExportService/LightTheme.css @@ -12,7 +12,13 @@ a { a:hover { text-decoration: underline; } -div.pre, span.pre { +div.pre { + background-color: #F9F9F9; + font-family: Consolas, Courier New, Courier, Monospace; + padding: 8px; +} + +span.pre { background-color: #F9F9F9; font-family: Consolas, Courier New, Courier, Monospace; padding-left: 2px; diff --git a/DiscordChatExporter/Services/ExportService.cs b/DiscordChatExporter/Services/ExportService.cs index 633a0239..23be9982 100644 --- a/DiscordChatExporter/Services/ExportService.cs +++ b/DiscordChatExporter/Services/ExportService.cs @@ -174,7 +174,7 @@ namespace DiscordChatExporter.Services // Preformatted multiline content = Regex.Replace(content, "```([^`]*?)```", - m => "
" + m.Groups[1].Value + "
"); + m => "
" + m.Groups[1].Value.Trim('\n') + "
"); // Preformatted inline content = Regex.Replace(content, "`([^`]*?)`", @@ -193,7 +193,7 @@ namespace DiscordChatExporter.Services content = Regex.Replace(content, "~~([^~]*?)~~", "$1"); // New lines - content = content.Replace("\n", "
"); + content = content.Replace("\n", "
"); return content; }