gatsby-remark-video-shortcode
Advanced tools
Comparing version 1.0.2 to 1.0.3
22
index.js
@@ -13,6 +13,2 @@ "use strict"; | ||
var extractString = function extractString(str) { | ||
return str.substring(1, str.length - 1); | ||
}; | ||
module.exports = function (_ref, pluginOptions) { | ||
@@ -33,11 +29,11 @@ var markdownAST = _ref.markdownAST; | ||
var x = tree.children[0].attributes; | ||
var url = extractString(x.url ? _.escape(x.url) : ""); | ||
var control = extractString(x.control); | ||
var loop = extractString(x.loop); | ||
var autoplay = extractString(x.autoplay); | ||
var muted = extractString(x.muted); | ||
var height = extractString(x.height); | ||
var width = extractString(x.width); | ||
var poster = extractString(x.poster ? _.escape(x.poster) : ""); | ||
var html = ("\n <div style=\"position: relative; margin-left: auto; margin-right: auto;\">\n <video " + (control && "controls=" + control) + " loop=" + loop + "\n " + (autoplay && muted && "autoplay=" + autoplay) + " allowfullscreen=true\n " + (muted && "muted=" + muted) + " height=" + height + " width=" + width + " poster=" + poster + ">\n <source src=" + url + " type=\"video/mp4\" />\n <source src=" + url + " type=\"video/ogg\" />\n <source src=" + url + " type=\"video/webm\" />\n </video>\n </div>\n\n ").trim(); | ||
var url = x.url ? _.escape(x.url) : ""; | ||
var control = x.control; | ||
var loop = x.loop; | ||
var autoplay = x.autoplay; | ||
var muted = x.muted; | ||
var height = x.height; | ||
var width = x.width; | ||
var poster = x.poster ? _.escape(x.poster) : ""; | ||
var html = ("\n <div style=\"position: relative; margin-left: auto; margin-right: auto;\">\n <video " + (control === "true" ? "controls" : "") + " " + (loop === "true" ? "loop" : "") + "\n " + (autoplay === "true" && muted === "true" ? "autoplay" : "") + " allowfullscreen=true\n " + (muted === "true" ? "muted=true" : "") + " height=" + height + " width=" + width + " poster=" + poster + ">\n <source src=" + url + " type=\"video/mp4\" />\n <source src=" + url + " type=\"video/ogg\" />\n <source src=" + url + " type=\"video/webm\" />\n </video>\n </div>\n\n ").trim(); | ||
node.type = "html"; | ||
@@ -44,0 +40,0 @@ node.children = undefined; |
{ | ||
"name": "gatsby-remark-video-shortcode", | ||
"description": "Processes videos in markdown so they can be used in the production build.", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"author": "Aayushi Agrawal aayushi.agrawal13@gmail.com", | ||
@@ -6,0 +6,0 @@ "bugs": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3254
37