Socket
Socket
Sign inDemoInstall

embeds

Package Overview
Dependencies
12
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.0 to 2.3.0

11

dist/parse-input.js

@@ -59,2 +59,13 @@ 'use strict';

};
}], [/(https?:)?\/\/(www\.)?facebook\.com\/([\w.-]+)\/(photos)\/([\w.-]+)\/([0-9]+)/, function (match) {
var user = match[3];
var albumId = match[5];
var id = match[6];
return {
type: 'facebook',
embedAs: 'photo',
user: user,
url: 'https://www.facebook.com/' + user + '/photos/' + albumId + '/' + id,
id: id
};
}], [/(https?:)?\/\/(www\.)?twitter\.com\/([\w.-]+)\/status\/([0-9]+)/, function (match) {

@@ -61,0 +72,0 @@ var user = match[3];

@@ -33,2 +33,14 @@ const allowed = [

}],
[/(https?:)?\/\/(www\.)?facebook\.com\/([\w.-]+)\/(photos)\/([\w.-]+)\/([0-9]+)/, match => {
const user = match[3];
const albumId = match[5];
const id = match[6];
return {
type: 'facebook',
embedAs: 'photo',
user: user,
url: `https://www.facebook.com/${user}/photos/${albumId}/${id}`,
id: id
};
}],
[/(https?:)?\/\/(www\.)?twitter\.com\/([\w.-]+)\/status\/([0-9]+)/, match => {

@@ -35,0 +47,0 @@ const user = match[3];

2

package.json
{
"name": "embeds",
"version": "2.2.0",
"version": "2.3.0",
"description": "Parse & render embeds",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -107,2 +107,15 @@ import test from './tape-wrapper';

const photoCode = tsml`
<div class="fb-post" data-href="https://www.facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738/?type=3" data-width="500" data-show-text="true">
<div class="fb-xfbml-parse-ignore">
<blockquote cite="https://www.facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738/?type=3">
<p>via Tumblr user kristine-claire.</p>
Posted by <a href="https://www.facebook.com/rewire.news/">Rewire</a> on&nbsp;
<a href="https://www.facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738/?type=3">
Tuesday, June 17, 2014
</a>
</blockquote>
</div>
</div>`;
const expectedVideo = {

@@ -172,2 +185,30 @@ type: 'facebook',

t.deepEqual(parseInput('//facebook.com/zuck/posts/10102593740125791'), expectedPost);
const expectedPhoto = {
type: 'facebook',
embedAs: 'photo',
user: 'rewire.news',
url: 'https://www.facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738',
id: '10152515593211738'
};
t.deepEqual(parseInput(photoCode), expectedPhoto);
t.deepEqual(
parseInput('https://www.facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738'),
expectedPhoto);
t.deepEqual(
parseInput('http://www.facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738'),
expectedPhoto);
t.deepEqual(
parseInput('//www.facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738'),
expectedPhoto);
t.deepEqual(
parseInput('https://facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738'),
expectedPhoto);
t.deepEqual(
parseInput('http://facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738'),
expectedPhoto);
t.deepEqual(
parseInput('//facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738'),
expectedPhoto);
});

@@ -174,0 +215,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc