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
|
end
|
||||||
|
|
||||||
def process_emoticons(message)
|
def process_emoticons(message)
|
||||||
map = {
|
map = [
|
||||||
"<3" => "♥",
|
["<3", "♥"],
|
||||||
":(" => "☹",
|
[":(", "☹"],
|
||||||
":-(" => "☹",
|
[":-(", "☹"],
|
||||||
":)" => "☺",
|
[":)", "☺"],
|
||||||
":-)" => "☺",
|
[":-)", "☺"],
|
||||||
"<->" => "↔",
|
["<->", "↔"],
|
||||||
"->" => "→",
|
["->", "→"],
|
||||||
"<-" => "←",
|
["<-", "←"],
|
||||||
"..." => "…",
|
["...", "…"],
|
||||||
"(tm)" => "™",
|
["(tm)", "™"],
|
||||||
"(r)" => "®",
|
["(r)", "®"],
|
||||||
"(c)" => "©"
|
["(c)", "©"]
|
||||||
}
|
]
|
||||||
|
|
||||||
map.each do |search, replace|
|
map.each do |mapping|
|
||||||
message.gsub!(search, replace)
|
message.gsub!(mapping[0], mapping[1])
|
||||||
end
|
end
|
||||||
message
|
message
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue