Open simison opened 9 years ago
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.
@gregjacobs even better so!
As far as I can tell, the last version handles the more flexible hashtags. Closing.
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?
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.: