hexo-generator-amp
Advanced tools
Comparing version 0.1.16 to 0.1.19
@@ -295,6 +295,5 @@ 'use strict'; | ||
if(instagram_shortCode && instagram_shortCode.length >= 2){ | ||
replaceStr = replaceStr.replace(igMatch[i],'<amp-instagram data-shortcode="' + instagram_shortCode[1] + '" width="500" height="500" layout="responsive"></amp-instagram>'); | ||
isInstagramContain = true; | ||
} | ||
replaceStr = replaceStr.replace(igMatch[i],'<amp-instagram data-shortcode="' + instagram_shortCode[1] + '" width="500" height="500" layout="responsive"></amp-instagram>'); | ||
isInstagramContain = true; | ||
} | ||
@@ -304,2 +303,15 @@ } | ||
//------------------------------------ | ||
// other iframe | ||
//------------------------------------ | ||
var ifElseMatch = replaceStr.match(/\<iframe.*?\>\<\/iframe\>/g); | ||
if(ifElseMatch){ | ||
for(i=0; i<ifElseMatch.length; i++){ | ||
var iframeSrc = ifElseMatch[i].match(/src\="(.*?)"/); | ||
if(iframeSrc && iframeSrc.length >= 2){ | ||
replaceStr = replaceStr.replace(ifElseMatch[i],'<a href="'+ iframeSrc[1] + '" target="_blank">' + iframeSrc[1] + '</a>'); | ||
} | ||
} | ||
} | ||
@@ -306,0 +318,0 @@ |
{ | ||
"name": "hexo-generator-amp", | ||
"version": "0.1.16", | ||
"version": "0.1.19", | ||
"main": "index", | ||
@@ -42,3 +42,5 @@ "dependencies": { | ||
"hexo", | ||
"amp" | ||
"amp", | ||
"google", | ||
"mobile" | ||
], | ||
@@ -45,0 +47,0 @@ "license": "MIT", |
91374
2312