mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-27 13:14:17 -04:00
Refactor css for 'pre' with modifiers
This commit is contained in:
parent
f0cd2dce1b
commit
7ecf90d1cb
4 changed files with 19 additions and 20 deletions
|
@ -9,14 +9,13 @@ a {
|
|||
color: #0096cf;
|
||||
}
|
||||
|
||||
.pre-multiline {
|
||||
background-color: #2F3136;
|
||||
border-color: #282b30;
|
||||
color: #839496;
|
||||
.pre {
|
||||
background-color: #2f3136;
|
||||
}
|
||||
|
||||
.pre-inline {
|
||||
background-color: #2f3136;
|
||||
.pre--multiline {
|
||||
border-color: #282b30;
|
||||
color: #839496;
|
||||
}
|
||||
|
||||
.mention {
|
||||
|
|
|
@ -9,13 +9,12 @@ a {
|
|||
color: #00b0f4;
|
||||
}
|
||||
|
||||
.pre-multiline {
|
||||
.pre {
|
||||
background-color: #f9f9f9;
|
||||
color: #657b83;
|
||||
}
|
||||
|
||||
.pre-inline {
|
||||
background-color: #f9f9f9;
|
||||
.pre--multiline {
|
||||
color: #657b83;
|
||||
}
|
||||
|
||||
/* === INFO === */
|
||||
|
|
|
@ -17,20 +17,21 @@ img {
|
|||
object-fit: contain;
|
||||
}
|
||||
|
||||
.pre-multiline {
|
||||
margin-top: 4px;
|
||||
padding: 8px;
|
||||
border: 2px solid;
|
||||
border-radius: 5px;
|
||||
.pre {
|
||||
font-family: "Consolas", "Courier New", Courier, Monospace;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.pre-inline {
|
||||
.pre--multiline {
|
||||
margin-top: 4px;
|
||||
padding: 8px;
|
||||
border: 2px solid;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.pre--inline {
|
||||
padding: 2px;
|
||||
border-radius: 3px;
|
||||
font-family: "Consolas", "Courier New", Courier, Monospace;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.emoji {
|
||||
|
|
|
@ -146,11 +146,11 @@ namespace DiscordChatExporter.Core.Services
|
|||
|
||||
// Decode and process multiline codeblocks
|
||||
content = Regex.Replace(content, "\x1AM(.*?)\x1AM",
|
||||
m => $"<div class=\"pre-multiline\">{m.Groups[1].Value.Base64Decode()}</div>");
|
||||
m => $"<div class=\"pre pre--multiline\">{m.Groups[1].Value.Base64Decode()}</div>");
|
||||
|
||||
// Decode and process inline codeblocks
|
||||
content = Regex.Replace(content, "\x1AI(.*?)\x1AI",
|
||||
m => $"<span class=\"pre-inline\">{m.Groups[1].Value.Base64Decode()}</span>");
|
||||
m => $"<span class=\"pre pre--inline\">{m.Groups[1].Value.Base64Decode()}</span>");
|
||||
|
||||
// Decode and process links
|
||||
if (allowLinks)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue