def replace_name_with_images(string)
      unless string && string.match(names_regex)
        return string
      end

      string.to_str.gsub(names_regex) do |match|
        if names.include?($1)
          %Q{<img class="emoji" src="//#{ image_url_for_name($1) }" />}
        else
          match
        end
      end
    end
def replace_name_with_images(string)
      unless string && string.match(names_regex)
        return string
      end

      string.to_str.gsub(names_regex) do |match|
        if names.include?($1)
          %Q{<img class="emoji" src="//#{ image_url_for_name($1) }" />}
        else
          match
        end
      end
    end
通过（名称）替换表情