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