Skip to content

Commit 8b1b68c

Browse files
committed
Build with instagram support for hashtags
1 parent 3c09a24 commit 8b1b68c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dist/Autolinker.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ var Autolinker = function( cfg ) {
134134

135135
// Validate the value of the `hashtag` cfg.
136136
var hashtag = this.hashtag;
137-
if( hashtag !== false && hashtag !== 'twitter' && hashtag !== 'facebook' ) {
137+
if( hashtag !== false && hashtag !== 'twitter' && hashtag !== 'facebook' && hashtag !== 'instagram' ) {
138138
throw new Error( "invalid `hashtag` cfg - see docs" );
139139
}
140140
};
@@ -178,6 +178,7 @@ Autolinker.prototype = {
178178
*
179179
* - 'twitter'
180180
* - 'facebook'
181+
* - 'instagram'
181182
*
182183
* Pass `false` to skip auto-linking of hashtags.
183184
*/
@@ -2510,6 +2511,8 @@ Autolinker.match.Hashtag = Autolinker.Util.extend( Autolinker.match.Match, {
25102511
return 'https://twitter.com/hashtag/' + hashtag;
25112512
case 'facebook' :
25122513
return 'https://www.facebook.com/hashtag/' + hashtag;
2514+
case 'instagram' :
2515+
return 'https://instagram.com/explore/tags/' + hashtag;
25132516

25142517
default : // Shouldn't happen because Autolinker's constructor should block any invalid values, but just in case.
25152518
throw new Error( 'Unknown service name to point hashtag to: ', serviceName );
@@ -2527,6 +2530,7 @@ Autolinker.match.Hashtag = Autolinker.Util.extend( Autolinker.match.Match, {
25272530
}
25282531

25292532
} );
2533+
25302534
/*global Autolinker */
25312535
/**
25322536
* @class Autolinker.match.Phone

0 commit comments

Comments
 (0)