Skip to content

Commit

Permalink
[yufushiro] カスタム絵文字のshortcodeに隣接できる文字種の制限を緩和
Browse files Browse the repository at this point in the history
  • Loading branch information
yufushiro committed Aug 10, 2023
1 parent 0334b1b commit bdb4260
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/custom_emoji.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bdb4260

Please sign in to comment.