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

More flexible hashtags #130

Open
simison opened this issue Nov 10, 2015 · 4 comments
Open

More flexible hashtags #130

simison opened this issue Nov 10, 2015 · 4 comments

Comments

@simison
Copy link
Contributor

simison commented Nov 10, 2015

Inspired by the discussion about mentions #119 — that all could be applied to hashtags as well. Updating more features at once in a backwards incompatible way makes sense, rather than having many of them in a row.

E.g.:

Autolinker.link( text, {
    hashtag: { 
        service: 'custom', // twitter (default), facebook, instagram, tumblr, google
        regex: '[A-Z][a-zA-Z0-9]{2, 13}',
        prefix: '#',
        template: 'http://my.website.com/{hashtag}' // 
    }
} );
@gregjacobs
Copy link
Owner

Hey, I like it. Autolinker will need some structural changes to support it, but would def like to move in that direction.

Btw, there's no need to break backward compatibility with this change. The hashtag option can accept either a string or an object. The string form will continue to accept the service name, while the object can be provided to provide more customizations.

@simison
Copy link
Contributor Author

simison commented Nov 11, 2015

@gregjacobs even better so!

@olafleur
Copy link
Collaborator

olafleur commented Mar 3, 2017

As far as I can tell, the last version handles the more flexible hashtags. Closing.

@olafleur olafleur closed this as completed Mar 3, 2017
@andryfailli
Copy link

Hi, I'm using v1.4.2 and I've configured autolinker with custom hashtag service as suggested in this issue.

Autolinker.link(text, {
	hashtag: { 
		service: 'custom', // twitter (default), facebook, instagram, tumblr, google
		regex: '[A-Z][a-zA-Z0-9]{2, 13}',
		prefix: '#',
		template: 'http://my.website.com/{hashtag}' // 
	}
})

But I'm receiving the following error

invalid hashtag cfg - see docs

Also in docs I didn't find any mention about the option to customize the hashtag urls...
Is this feature supported?

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

No branches or pull requests

4 participants