hexo-generator-amp
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -111,6 +111,6 @@ 'use strict'; | ||
//------------------------------------ | ||
var youtubeMatch = replaceStr.match(/\<iframe\ssrc\=\"\/\/www\.youtube\.com\/embed\/[0-9a-zA-Z]+\"\sframeborder\=\"0\"\sallowfullscreen\>\<\/iframe\>/g); | ||
var youtubeMatch = replaceStr.match(/\<iframe\ssrc\=\"\/\/www\.youtube\.com\/embed\/[0-9a-zA-Z-]+\"\sframeborder\=\"0\"\sallowfullscreen\>\<\/iframe\>/g); | ||
if(youtubeMatch){ | ||
for(i=0; i<youtubeMatch.length; i++){ | ||
var youtueb_id = youtubeMatch[i].match(/\/embed\/([0-9a-zA-Z]+)\"/); | ||
var youtueb_id = youtubeMatch[i].match(/\/embed\/([0-9a-zA-Z-]+)\"/); | ||
replaceStr = replaceStr.replace(youtubeMatch[i],'<amp-youtube data-videoid="'+youtueb_id[1]+'" width="1920" height="1080" layout="responsive"></amp-youtube>'); | ||
@@ -124,6 +124,6 @@ isYoutubeContain = true; | ||
//------------------------------------ | ||
var vimeoMatch = replaceStr.match(/\<iframe\ssrc\=\"\/\/player\.vimeo\.com\/video\/[0-9a-zA-Z]+\"\sframeborder\=\"0\"\sallowfullscreen\>\<\/iframe\>/g); | ||
var vimeoMatch = replaceStr.match(/\<iframe\ssrc\=\"\/\/player\.vimeo\.com\/video\/[0-9a-zA-Z-]+\"\sframeborder\=\"0\"\sallowfullscreen\>\<\/iframe\>/g); | ||
if(vimeoMatch){ | ||
for(i=0; i<vimeoMatch.length; i++){ | ||
var youtueb_id = vimeoMatch[i].match(/\/video\/([0-9a-zA-Z]+)\"/); | ||
var youtueb_id = vimeoMatch[i].match(/\/video\/([0-9a-zA-Z-]+)\"/); | ||
replaceStr = replaceStr.replace(vimeoMatch[i],'<amp-vimeo data-videoid="'+youtueb_id[1]+'" width="1920" height="1080" layout="responsive"></amp-vimeo>'); | ||
@@ -130,0 +130,0 @@ isVimeoContain = true; |
{ | ||
"name": "hexo-generator-amp", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"main": "index", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
48055