Comparing version 1.4.0 to 1.5.0
@@ -56,2 +56,5 @@ var Mehdown; | ||
//Kickstarter | ||
text = text.replace(/<a href="https?:\/\/(?:www\.)?(?:kickstarter\.com\/projects\/)?(\d+)\/([\w-]+).*">https?:\/\/(?:www\.)?(?:kickstarter\.com\/projects\/)?(\d+)\/([\w-]+).*<\/a>/g, Mehdown.kickstarter('$1', '$2')); | ||
// Anchors | ||
@@ -119,2 +122,6 @@ var anchorRegExp = new RegExp('<a[^>]*>([^<]+)</a>', 'gi'); | ||
Mehdown.kickstarter = function(kickstarterId, slug) { | ||
return '<iframe class="kickstarter" frameborder="0" scrolling="no" src="//www.kickstarter.com/projects/' + kickstarterId + '/' + slug + '/widget/card.html"></iframe>'; | ||
}; | ||
Mehdown.vine = function(videoId) { | ||
@@ -126,2 +133,2 @@ return '<iframe allowfullscreen class="vine" frameborder="0" src="//vine.co/v/' + videoId + '/embed/simple"></iframe>'; | ||
return '<iframe allowfullscreen class="youtube" frameborder="0" src="//www.youtube.com/embed/' + videoId + '"></iframe>'; | ||
}; | ||
}; |
@@ -13,3 +13,3 @@ { | ||
}, | ||
"version": "1.4.0" | ||
"version": "1.5.0" | ||
} |
@@ -12,7 +12,9 @@ mehdown | ||
- Support for spoilers in the BBCode syntax of: [spoiler]This text will be blurred until you mouse over it[/spoiler] | ||
- Support for strikethrough using ~~strikethrough~~ syntax | ||
- Support for Twitter status embeds | ||
- Support for Vimeo and YouTube video embeds | ||
- Support for SoundCloud audio embeds | ||
- Support for Kickstarter embeds | ||
- Support for opening external links in a new browser tab/window | ||
[![Build Status](https://travis-ci.org/mediocre/mehdown.png?branch=master)](https://travis-ci.org/mediocre/mehdown) |
@@ -132,2 +132,10 @@ var assert = require('assert'); | ||
}); | ||
}); | ||
describe('Kickstarter URLs', function() { | ||
it('https://www.kickstarter.com/projects/1270124222/crossing-paths-film-photography-documentary?ref=discover_rec', function() { | ||
var body = '<p><a href="https://www.kickstarter.com/projects/1270124222/crossing-paths-film-photography-documentary?ref=discover_rec">https://www.kickstarter.com/projects/1270124222/crossing-paths-film-photography-documentary?ref=discover_rec</a></p>'; | ||
var text = mehdown.parse(body); | ||
assert.equal(text, '<p><iframe class="kickstarter" frameborder="0" scrolling="no" src="//www.kickstarter.com/projects/1270124222/crossing-paths-film-photography-documentary/widget/card.html"></iframe></p>'); | ||
}); | ||
}); |
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
25997
216
20