gregjacobs / Autolinker.js

Utility to Automatically Link URLs, Email Addresses, Phone Numbers, Twitter handles, and Hashtags in a given block of text/HTML
MIT License
1.48k stars 238 forks source link

Hashtags don't work #135

Closed noodlebreak closed 8 years ago

noodlebreak commented 8 years ago

I'm doing this:

// Parse to find links and make links clickable
message_text = Autolinker.link(message_text, email=true, twitter=true, hashtag='twitter')

And it very beautifully parses links (google.com or http://google.com etc), twitter handles, email addresses (thank you!), but it fails to parse hashtags.

Am I doing something wrong?

simison commented 8 years ago

Would you have an example message_text to demonstrate the issue? Could be #115?

noodlebreak commented 8 years ago

They're not Cyrillic symbols, as in #115. They're simply English words. I tried out a bunch like #StarWars, #Yoda, #Python. None worked.

gregjacobs commented 8 years ago

Hey, if you're still having this issue (2 months later..), you're not calling the method correctly. Should be:

message_text = Autolinker.link( message_text, { email: true, twitter: true, hashtag: 'twitter' } );

Unless you're using CoffeeScript or some other transpiler in which case I have no idea how that works :)