aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorIllia <[email protected]>2017-01-11 15:26:06 +0300
committerIllia <[email protected]>2017-01-11 15:26:06 +0300
commit2b237e7de221beab9c516d6de29f83188ef63840 (patch)
tree2e801eb783f8184bd7b72cfb2bc4880d1ab3a2a2 /src/utils
parentUse zero-width space for mention prevention (diff)
downloadserenity-2b237e7de221beab9c516d6de29f83188ef63840.tar.xz
serenity-2b237e7de221beab9c516d6de29f83188ef63840.zip
Stop abusing unicode for sanitisation
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/message_builder.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/message_builder.rs b/src/utils/message_builder.rs
index fc6882d..995be87 100644
--- a/src/utils/message_builder.rs
+++ b/src/utils/message_builder.rs
@@ -189,7 +189,7 @@ impl MessageBuilder {
pub fn push_codeblock_safe(mut self, content: &str, language: Option<&str>)
-> Self {
let content = &normalize(content)
- .replace("```", "\u{201B}\u{201B}\u{201B}");
+ .replace("```", "'''");
self.0.push_str("```");
@@ -207,7 +207,7 @@ impl MessageBuilder {
/// Pushes an inline monospaced text to your message normalizing content.
pub fn push_mono_safe(mut self, content: &str) -> Self {
self.0.push('`');
- self.0.push_str(&normalize(content).replace("`", "\u{201B}"));
+ self.0.push_str(&normalize(content).replace('`', "'"));
self.0.push('`');
self
@@ -216,7 +216,7 @@ impl MessageBuilder {
/// Pushes an inline italicized text to your message normalizing content.
pub fn push_italic_safe(mut self, content: &str) -> Self {
self.0.push('_');
- self.0.push_str(&normalize(content).replace('_', "_"));
+ self.0.push_str(&normalize(content).replace('_', " "));
self.0.push('_');
self
@@ -225,7 +225,7 @@ impl MessageBuilder {
/// Pushes an inline bold text to your message normalizing content.
pub fn push_bold_safe(mut self, content: &str) -> Self {
self.0.push_str("**");
- self.0.push_str(&normalize(content).replace("**", "∗∗"));
+ self.0.push_str(&normalize(content).replace("**", " "));
self.0.push_str("**");
self
@@ -234,7 +234,7 @@ impl MessageBuilder {
/// Pushes an underlined inline text to your message normalizing content.
pub fn push_underline_safe(mut self, content: &str) -> Self {
self.0.push_str("__");
- self.0.push_str(&normalize(content).replace("__", "__"));
+ self.0.push_str(&normalize(content).replace("__", " "));
self.0.push_str("__");
self
@@ -243,7 +243,7 @@ impl MessageBuilder {
/// Pushes a strikethrough inline text to your message normalizing content.
pub fn push_strike_safe(mut self, content: &str) -> Self {
self.0.push_str("~~");
- self.0.push_str(&normalize(content).replace("~~", "∼∼"));
+ self.0.push_str(&normalize(content).replace("~~", " "));
self.0.push_str("~~");
self