diff --git a/app/helpers/markdownify_helper.rb b/app/helpers/markdownify_helper.rb index 5d82f33a6..8131de113 100644 --- a/app/helpers/markdownify_helper.rb +++ b/app/helpers/markdownify_helper.rb @@ -112,23 +112,23 @@ module MarkdownifyHelper end def process_emoticons(message) - map = { - "<3" => "♥", - ":(" => "☹", - ":-(" => "☹", - ":)" => "☺", - ":-)" => "☺", - "<->" => "↔", - "->" => "→", - "<-" => "←", - "..." => "…", - "(tm)" => "™", - "(r)" => "®", - "(c)" => "©" - } + map = [ + ["<3", "♥"], + [":(", "☹"], + [":-(", "☹"], + [":)", "☺"], + [":-)", "☺"], + ["<->", "↔"], + ["->", "→"], + ["<-", "←"], + ["...", "…"], + ["(tm)", "™"], + ["(r)", "®"], + ["(c)", "©"] + ] - map.each do |search, replace| - message.gsub!(search, replace) + map.each do |mapping| + message.gsub!(mapping[0], mapping[1]) end message end