Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose embedAs object key for twitter video embeds #4

Merged
merged 3 commits into from Jun 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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