Fix div.pre output styling

pull/17/head
Alexey Golub 7 years ago
parent a556926fe6
commit b110413c08

@ -12,7 +12,13 @@ a {
a:hover { text-decoration: underline; } 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; background-color: #2F3136;
font-family: Consolas, Courier New, Courier, Monospace; font-family: Consolas, Courier New, Courier, Monospace;
padding-left: 2px; padding-left: 2px;

@ -12,7 +12,13 @@ a {
a:hover { text-decoration: underline; } 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; background-color: #F9F9F9;
font-family: Consolas, Courier New, Courier, Monospace; font-family: Consolas, Courier New, Courier, Monospace;
padding-left: 2px; padding-left: 2px;

@ -174,7 +174,7 @@ namespace DiscordChatExporter.Services
// Preformatted multiline // Preformatted multiline
content = Regex.Replace(content, "```([^`]*?)```", content = Regex.Replace(content, "```([^`]*?)```",
m => "<div class=\"pre\">" + m.Groups[1].Value + "</div>"); m => "<div class=\"pre\">" + m.Groups[1].Value.Trim('\n') + "</div>");
// Preformatted inline // Preformatted inline
content = Regex.Replace(content, "`([^`]*?)`", content = Regex.Replace(content, "`([^`]*?)`",
@ -193,7 +193,7 @@ namespace DiscordChatExporter.Services
content = Regex.Replace(content, "~~([^~]*?)~~", "<s>$1</s>"); content = Regex.Replace(content, "~~([^~]*?)~~", "<s>$1</s>");
// New lines // New lines
content = content.Replace("\n", "</br>"); content = content.Replace("\n", "<br />");
return content; return content;
} }

Loading…
Cancel
Save