mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-28 10:22:38 +03:00
fixed youtube link
This commit is contained in:
parent
b1eb6d8835
commit
d929fc493d
@ -130,11 +130,17 @@ const createFromDoubleImageLink = input => input.replace(onlyImageDoubleLinkRege
|
||||
});
|
||||
|
||||
const createYoutubeIframe = input => input.replace(youTubeRegex, (link) => {
|
||||
const videoID = link.split('=')[1];
|
||||
const execVideo = youTubeRegex.exec(link);
|
||||
const match = link.match(youTubeRegex);
|
||||
|
||||
const embedLink = `https://www.youtube.com/embed/${videoID}`;
|
||||
if (execVideo[1] && match) {
|
||||
const videoLink = execVideo[1];
|
||||
const embedLink = `https://www.youtube.com/embed/${videoLink}`;
|
||||
|
||||
return iframeBody(embedLink);
|
||||
return iframeBody(embedLink);
|
||||
}
|
||||
|
||||
return link;
|
||||
});
|
||||
|
||||
const createDtubeIframe = input => input.replace(dTubeRegex, (link) => {
|
||||
@ -153,5 +159,5 @@ const createVimeoIframe = input => input.replace(vimeoRegex, (link) => {
|
||||
return iframeBody(embedLink);
|
||||
});
|
||||
|
||||
const iframeBody = link => `<iframe frameborder='0' src="${link}"></iframe>`;
|
||||
const iframeBody = link => `<iframe frameborder='0' src='${link}'></iframe>`;
|
||||
const imageBody = link => `<img data-href="${link}" src="${link}">`;
|
||||
|
Loading…
Reference in New Issue
Block a user