Skip to content

Request: Adding a new hashtag provider #336

@the-conqueror-97

Description

@the-conqueror-97

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);
}
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions