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

Request: Adding a new hashtag provider #336

Open
the-conqueror-97 opened this issue Mar 12, 2021 · 1 comment
Open

Request: Adding a new hashtag provider #336

the-conqueror-97 opened this issue Mar 12, 2021 · 1 comment

Comments

@the-conqueror-97
Copy link

Hi, i just found this library and i believe it can be improved.
So i would like to add one more provider to the project.

So we have already Facebook, Twitter and Instagram.
I would like to add "Aktagram".

If it could be added as soon as possible it would be nice.

/**
* Returns the anchor href that should be generated for the match.
*
* @return {String}
*/
HashtagMatch.prototype.getAnchorHref = function () {
var serviceName = this.serviceName, hashtag = this.hashtag;
switch (serviceName) {
case 'twitter':
return 'https://twitter.com/hashtag/' + hashtag;
case 'facebook':
return 'https://www.facebook.com/hashtag/' + hashtag;
case 'instagram':
return 'https://instagram.com/explore/tags/' + hashtag;
case 'aktagram':
return 'https://aktagram.com/hashtag/' + hashtag;
default: // Shouldn't happen because Autolinker's constructor should block any invalid values, but just in case.
throw new Error('Unknown service name to point hashtag to: ' + serviceName);
}
};

@olafleur
Copy link
Collaborator

PRs are welcome! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants