diff options
author | Sean McGivern <sean@gitlab.com> | 2017-04-27 11:02:27 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-04-27 11:02:27 +0100 |
commit | 2df748aa71d6c636c82ed2a0a8dde8ebf6bfc7f2 (patch) | |
tree | aae6ce8fac0775b15b65ce26afb3f700de030948 /lib/banzai | |
parent | 4bdbcf594812d35bab3c2b597fc8087f840bbd4d (diff) | |
parent | 31c990cc41e2dc7576cf867a313862a07fd8c170 (diff) | |
download | gitlab-ce-2df748aa71d6c636c82ed2a0a8dde8ebf6bfc7f2.tar.gz |
Merge branch 'blackst0ne/gitlab-ce-fix_emoji_parser'
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/emoji_filter.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/banzai/filter/emoji_filter.rb b/lib/banzai/filter/emoji_filter.rb index d6138816e70..6255a611dbe 100644 --- a/lib/banzai/filter/emoji_filter.rb +++ b/lib/banzai/filter/emoji_filter.rb @@ -53,7 +53,10 @@ module Banzai # Build a regexp that matches all valid :emoji: names. def self.emoji_pattern - @emoji_pattern ||= /:(#{Gitlab::Emoji.emojis_names.map { |name| Regexp.escape(name) }.join('|')}):/ + @emoji_pattern ||= + /(?<=[^[:alnum:]:]|\n|^) + :(#{Gitlab::Emoji.emojis_names.map { |name| Regexp.escape(name) }.join('|')}): + (?=[^[:alnum:]:]|$)/x end # Build a regexp that matches all valid unicode emojis names. |