Skip to content

Commit

Permalink
Embed YouTube shorts
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Nov 4, 2023
1 parent 413b7fc commit e4cddac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@ export default class MarkdownEditor extends PureComponent {
) ||
lineContent.match(
/(?:^|\s)(?:https?:)?\/\/youtu\.be\/([A-Za-z0-9_-]{11})(?:\s|&|$)/
);
) ||
lineContent.match(
/(?:^|\s)(?:https?:)?\/\/(?:www\.)?youtube\.com\/shorts\/([A-Za-z0-9_-]{11})(?:\s|&|$)/
)

if (match) {
this._addLineWidget(
Expand Down
2 changes: 1 addition & 1 deletion app/utils/Links.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
image: image(),
imageFile: imageFile(),
youTube: youTube(),
youTubeId: /(?:(?:youtube.com\/watch\?v=)|(?:youtu.be\/)|(?:youtube.com\/embed\/))([A-Za-z0-9_-]+)/i,
youTubeId: /(?:(?:youtube.com\/watch\?v=)|(?:youtu.be\/)|(?:youtube.com\/shorts\/)|(?:youtube.com\/embed\/))([A-Za-z0-9_-]+)/i,
vimeoId: /(?:vimeo.com\/|player.vimeo.com\/video\/)([0-9]+)/,
coubId: /(?:(?:https?:)?\/\/)?coub\.com\/view\/([A-Za-z0-9]+)/,
rutubeId: /(?:(?:https?:)?\/\/)?rutube\.ru\/video\/([A-Za-z0-9]+)\/?/,
Expand Down

0 comments on commit e4cddac

Please sign in to comment.