more fixes to JS youtube regex

This commit is contained in:
Thibault Duplessis 2017-01-24 18:19:44 +01:00
parent f57d48608e
commit a3fefd9bb8

View file

@ -15,7 +15,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|youtu\.be)\/(?:watch)?(?:\?v=)?([^"&?\/ ]{11})(?:[^\s]*)/gi;
function embedYoutube(text) {
return m.trust(lichess.escapeHtml(text).replace(commentYoutubeRegex, function(m, id) {