use an array of arrays instead of a hash to ensure order, thanks REE!

This commit is contained in:
MrZYX 2011-06-30 23:40:41 +02:00
parent 4e48db23f0
commit 05907246e9

View file

@ -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