use an array of arrays instead of a hash to ensure order, thanks REE!
This commit is contained in:
parent
4e48db23f0
commit
05907246e9
1 changed files with 16 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue