Skip to content

Commit

Permalink
improve utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed Feb 25, 2023
1 parent 33474b9 commit 33a55fb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Sources/DiscordUtilities/DiscordUtils.swift
Expand Up @@ -107,12 +107,13 @@ public enum DiscordUtils {
) -> String {
text
.replacingOccurrences(of: #"\"#, with: #"\\"#)
.replacingOccurrences(of: #"|"#, with: #"\|"#)
.replacingOccurrences(of: #">"#, with: #"\>"#)
.replacingOccurrences(of: #"<"#, with: #"\<"#)
.replacingOccurrences(of: #"`"#, with: #"\`"#)
.replacingOccurrences(of: #"~"#, with: #"\~"#)
.replacingOccurrences(of: #"_"#, with: #"\_"#)
.replacingOccurrences(of: #"*"#, with: #"\*"#)
.replacingOccurrences(of: #"|"#, with: #"\|"#) /// Makes invisible
.replacingOccurrences(of: #">"#, with: #"\>"#) /// Quotes
.replacingOccurrences(of: #"<"#, with: #"\<"#) /// `<::>` ids like custom emojis
.replacingOccurrences(of: #"`"#, with: #"\`"#) /// Code blocks
.replacingOccurrences(of: #"~"#, with: #"\~"#) /// Crosses the words
.replacingOccurrences(of: #"_"#, with: #"\_"#) /// Italic
.replacingOccurrences(of: #"*"#, with: #"\*"#) /// Bold
.replacingOccurrences(of: #":"#, with: #"\:"#) /// Emojis like `:key:`
}
}

0 comments on commit 33a55fb

Please sign in to comment.