diff --git a/app/models/custom_emoji.rb b/app/models/custom_emoji.rb index 7e9eb91ca5..58828b0c4c 100644 --- a/app/models/custom_emoji.rb +++ b/app/models/custom_emoji.rb @@ -30,9 +30,7 @@ class CustomEmoji < ApplicationRecord SHORTCODE_RE_FRAGMENT = '[a-zA-Z0-9_]{2,}' - SCAN_RE = /(?<=[^[:alnum:]:]|\n|^) - :(#{SHORTCODE_RE_FRAGMENT}): - (?=[^[:alnum:]:]|$)/x + SCAN_RE = /:(#{SHORTCODE_RE_FRAGMENT}):/x SHORTCODE_ONLY_RE = /\A#{SHORTCODE_RE_FRAGMENT}\z/ IMAGE_MIME_TYPES = %w(image/png image/gif image/webp).freeze