about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-09-23 14:47:32 +0200
committerGitHub <noreply@github.com>2017-09-23 14:47:32 +0200
commit1e02ba111ae38ab758135b5b2b46f34c672ca02e (patch)
tree62c916782bf9340837a12fcb0c79bb9d481b4ce8 /app/helpers
parent66126f302167d21e4bf247e660f595ff0beaaf20 (diff)
Add emoji autosuggest (#5053)
* Add emoji autosuggest

Some credit goes to glitch-soc/mastodon#149

* Remove server-side shortcode->unicode conversion

* Insert shortcode when suggestion is custom emoji

* Remove remnant of server-side emojis

* Update style of autosuggestions

* Fix wrong emoji filenames generated in autosuggest item

* Do not lazy load emoji picker, as that no longer works

* Fix custom emoji autosuggest

* Fix multiple "Custom" categories getting added to emoji index, only add once
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/emoji_helper.rb24
1 files changed, 0 insertions, 24 deletions
diff --git a/app/helpers/emoji_helper.rb b/app/helpers/emoji_helper.rb
deleted file mode 100644
index 848c03fce..000000000
--- a/app/helpers/emoji_helper.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-module EmojiHelper
-  def emojify(text)
-    return text if text.blank?
-
-    text.gsub(emoji_pattern) do |match|
-      emoji = Emoji.instance.unicode($1) # rubocop:disable Style/PerlBackrefs
-
-      if emoji
-        emoji
-      else
-        match
-      end
-    end
-  end
-
-  def emoji_pattern
-    @emoji_pattern ||=
-      /(?<=[^[:alnum:]:]|\n|^)
-      (#{Emoji.instance.names.map { |name| Regexp.escape(name) }.join('|')})
-      (?=[^[:alnum:]:]|$)/x
-  end
-end