Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

magicpen-media

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magicpen-media - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

19

lib/magicPenMedia.js

@@ -26,2 +26,4 @@ /*global URL, Blob, btoa*/

var height = options.height || 0;
var alt = options.alt;
var title = options.title;

@@ -36,2 +38,5 @@ this.alt({

src = media;
if (typeof title === 'undefined' && !/^data:/.test(media)) {
title = media;
}
} else if (typeof URL !== 'undefined' && typeof URL.createObjectURL === 'function' && typeof Blob !== 'undefined') {

@@ -50,2 +55,11 @@ src = URL.createObjectURL(new Blob([media], { type: sanitizeContentType(contentType) }));

var attributes = [ 'src="' + entitify(src) + '"' ];
if (typeof alt !== 'undefined') {
attributes.push('alt="' + entitify(String(alt)) + '"');
}
if (typeof title !== 'undefined') {
attributes.push('title="' + entitify(String(title)) + '"');
}
var styleProperties = [];

@@ -58,4 +72,7 @@ if (width) {

}
if (styleProperties.length) {
attributes.push('style="' + entitify(styleProperties.join('; ')) + '"');
}
var attributeStr = (styleProperties.length ? ' style="' + entitify(styleProperties.join('; ')) + '"' : '') + ' src="' + entitify(src) + '"';
var attributeStr = attributes.length ? ' ' + attributes.join(' ') : '';
if (!majorContentType || majorContentType === 'image') {

@@ -62,0 +79,0 @@ return '<img' + attributeStr + '>';

2

package.json
{
"name": "magicpen-media",
"version": "1.2.0",
"version": "1.3.0",
"description": "Add media support to magicpen (images, audio, video)",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc