Skip to content

Commit 8d161ed

Browse files
authored
Update StationReportDiscordIntergrationSystem.cs (ProjectOmu#138)
* Update StationReportDiscordIntergrationSystem.cs * Update Content.Goobstation.Server/StationReport/StationReportDiscordIntergrationSystem.cs * Update Content.Goobstation.Server/StationReport/StationReportDiscordIntergrationSystem.cs * Update Content.Goobstation.Server/StationReport/StationReportDiscordIntergrationSystem.cs
1 parent 57b039e commit 8d161ed

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Content.Goobstation.Server/StationReport/StationReportDiscordIntergrationSystem.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ public override void Initialize()
3434

3535
private static readonly TagReplacement[] _replacements =
3636
{
37+
// Discord markdown replacements, these must happen BEFORE anything else!
38+
new(@"\*", @"\*"), // Omu, escape * so it doesn't unintentionally bold stuff in Discord (this is intentionally double-escaped in the literal string for regex replacements)
39+
new(@"_", @"\_"), // Omu, escape _ so it doesn't unintentionally italics stuff in Discord
40+
new(@"~", @"\~"), // Omu, escape ~ so it doesn't unintentionally strikethrough stuff in Discord
41+
new(@"`", @"\`"), // Omu, escape ` so it doesn't unintentionally codeblock stuff in Discord
42+
new(@"#", @"\#"), // Omu, escape # so it doesn't unintentionally header stuff in Discord
43+
new(@">", @"\>"), // Omu, escape > so it doesn't unintentionally quoteblock stuff in Discord
44+
// End of Discord markdown replacements, other stuff can come AFTER this.
3745
new(@"\[/?bold\]", @"**"),
3846
new(@"\[/?italic\]", @"_"),
3947
new(@"\[/?mono\]", @"__"),

0 commit comments

Comments
 (0)