Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added allURLs

  • Loading branch information...
commit e0d062c68143ce77ecb5ff017ecdc68f3532b850 1 parent 74e15b8
@amix amix authored
View
4 lib/media-parser.js
@@ -41,6 +41,10 @@ MediaParser = {
var pattern;
pattern = MediaServices.getProvidersPattern();
return content.match(pattern) || [];
+ },
+ url_pattern: /https?:\/\/[^\s]+/gi,
+ allURLs: function(content) {
+ return content.match(MediaParser.url_pattern) || [];
}
};
View
2  package.json
@@ -3,7 +3,7 @@
"description": "Simple JavaScript library to ease integration with media and oEmbed.",
"keywords": ["oembed", "media", "thumbnails", "preview"],
"author": "amix",
- "version": "1.4.0",
+ "version": "1.4.1",
"dependencies": {},
"repository": "https://github.com/Doist/media-parser",
"licenses": [{
View
4 src/media_parser.coffee
@@ -37,4 +37,8 @@ MediaParser = {
pattern = MediaServices.getProvidersPattern()
return content.match(pattern) or []
+ url_pattern: /https?:\/\/[^\s]+/gi
+ allURLs: (content) ->
+ return content.match(MediaParser.url_pattern) or []
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.