Skip to content

Commit

Permalink
fixes commentYoutubeRegex with syntax closes #2715
Browse files Browse the repository at this point in the history
  • Loading branch information
Unihedro committed Mar 1, 2017
1 parent 9153e01 commit 19c8253
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/analyse/src/study/studyComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function authorText(author) {
return author.name;
}

var commentYoutubeRegex = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch)?(?:\?v=)?(?:[^"&?\/ ]{11})\S*/gi;
var commentYoutubeRegex = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:.*?(?:[?&]v=)|v\/)|youtu\.be\/)(?:[^"&?\/ ]{11})\b/gi;

function embedYoutube(text, allowNewlines) {
var html = lichess.escapeHtml(text).replace(commentYoutubeRegex, function(found) {
Expand Down

0 comments on commit 19c8253

Please sign in to comment.