Skip to content

Commit

Permalink
Merge pull request #4 from nazar/master
Browse files Browse the repository at this point in the history
expose embedAs object key for twitter video embeds
  • Loading branch information
kesla committed Jun 20, 2016
2 parents 917e501 + 0000f3a commit 0cf66cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Expand Up @@ -17,10 +17,10 @@ function renderSpotify ({url, height}) {
const embeds = {
youtube: ({youtubeId}) => render({type: 'youtube', youtubeId}),
image: ({src}) => render({type: 'image', src}),
twitter: ({text, url, date, user, id}) => (<iframe>
twitter: ({embedAs, text, url, date, user, id}) => (<iframe>
{render({
type: 'twitter',
text, url, date, user, id
embedAs, text, url, date, user, id
})}
<script async='true' src='//platform.twitter.com/widgets.js' charset='utf-8'></script>
</iframe>),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"article-json-html-render": "^2.0.0",
"deku": "^1.0.0",
"embeds": "^2.0.0",
"embeds": "^2.5.0",
"magic-virtual-element": "^1.0.6",
"object-assign": "^4.0.1",
"url-join": "^1.1.0"
Expand Down
3 changes: 2 additions & 1 deletion test.js
Expand Up @@ -151,6 +151,7 @@ test('twitter', t => {
const input = [{
type: 'embed',
embedType: 'twitter',
embedAs: 'tweet',
text: [
{content: 'GIF vs. JIF… This ', href: null},
{content: 'pic.twitter.com/qFAHWgdbL6', href: 'https://t.co/qFAHWgdbL6'}
Expand All @@ -168,7 +169,7 @@ test('twitter', t => {
<article>
<figure class="op-social">
<iframe>
<blockquote class="twitter-tweet" lang="en">
<blockquote class="twitter-tweet" data-lang="en">
<p lang="en" dir="ltr">GIF vs. JIF… This <a href="https://t.co/qFAHWgdbL6">pic.twitter.com/qFAHWgdbL6</a></p>&mdash; Matt (foo) Navarra (@MattNavarra) <a href="https://twitter.com/MattNavarra/status/684690494841028608">January 6, 2016</a>
</blockquote>
<script async="true" src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
Expand Down

0 comments on commit 0cf66cd

Please sign in to comment.