Skip to content

Commit

Permalink
Remove newline from regex for shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Apr 19, 2024
1 parent 9235d2c commit ffbae70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/compose.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const HASHTAG_RE = new RegExp(
// https://github.com/mastodon/mastodon/blob/23e32a4b3031d1da8b911e0145d61b4dd47c4f96/app/models/custom_emoji.rb#L31
const SHORTCODE_RE_FRAGMENT = '[a-zA-Z0-9_]{2,}';
const SCAN_RE = new RegExp(
`([^A-Za-z0-9_:\\n]|^)(:${SHORTCODE_RE_FRAGMENT}:)(?=[^A-Za-z0-9_:]|$)`,
`(^|[^=\\/\\w])(:${SHORTCODE_RE_FRAGMENT}:)(?=[^A-Za-z0-9_:]|$)`,
'g',
);

Expand Down

0 comments on commit ffbae70

Please sign in to comment.