-
Notifications
You must be signed in to change notification settings - Fork 239
Add support for usernames across more social networks #119
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
Comments
Hey, sorry for the late response here. Currently Autolinker only has built-in support for Twitter and there's really no way to override it, but I like the idea of a |
I feel like Twitter username should be something generic rather than tight to one service. It could default to twitter, but user should be able to defined the URL and syntax easily. For this it would make sense to rename twitter thing to something else, so it would be a breaking change. My usercase would be to use it with my own site's usernames, actually. |
Definitely agree, and interesting point too for your own website. I think we can maintain backward compatibility though for the options, where the newer Any ideas on how you might like the options laid out for this? My initial thought is something like this:
And then for the use case of your own website, you can always use the
Thoughts? |
Yeah and I feel like passing regexp as an option should be possible as well, since someone might want to support _-. and capital letters and some just lowercase a-z. Oh and sometimes you might want to recognise capital letters but have them lowercase at the URL. |
Personally, I'd prefer the term 'mention' rather than 'username', but that would break backwards compatibility unless made as an alias. Secondly, I'd probably use I agree that there should be an optional regex option and a way to set the prefixing character/regex, seeing as services such as Google+ use a eg. Autolinker.link( text, {
mention: {
service: 'custom', // twitter (default), facebook, instagram, tumblr, google
regex: '[A-Z][a-zA-Z0-9]{2, 13}',
prefix: '+',
template: 'http://my.website.com/{username}' //
}
} ); |
+1 @devonzara; good thinking! |
👍 Any word on this? |
Resurecting in 3...2...1 |
I'd be willing to help out on a PR if we can agree on a syntax. |
blockquote, div.yahoo_quoted { margin-left: 0 !important; border-left:1px #715FFA solid !important; padding-left:1ex !important; background-color:white !important; } Hey, yes, so sorry, I'm so crazy busy these days. What are your thoughts on that? Sent from Yahoo Mail for iPhone On Monday, June 13, 2016, 12:30 PM, J. Miller [email protected] wrote: I'd be willing to help out on a PR if we can agree on a syntax. — |
@jmillerdesign : as of today, we have, mentions for Twitter and Instagram. With the current structure, I guess it would be relatively easy to add Facebook and Tumblr if this is still wanted. |
Could this either be added to the core, or could you explain how I could pass options to Autolinker.js to allow for this? It's limiting usernames to 15 characters, but other networks support longer usernames.
Twitter: 15
Instagram: 30
Facebook: 50
Tumblr: 32
The text was updated successfully, but these errors were encountered: