Web tweet box counts URL characters incorrectly (excluding the fragment identifier)


#1

The tweet box on twitter.com and the tweet intent popup appears not to consider fragment identifiers (hashes) as valid in URLs, so it counts them toward the available character count. Check it out:

https://twitter.com/intent/tweet?text=This%20URL%20should%20leave%20plenty%20of%20room%20for%20more%20text%2C%20but%20your%20JavaScript%20thinks%20it%20ends%20at%20the%20hash%3A%20http%3A%2F%2Fexample.com%23verylonghashwithlotsofcharacters

This says there are -13 characters remaining, and that number goes up or down if you change the fragment identifier. Paste that tweet text into the native app, though, and it correctly highlights the link and says that I’ve got 20 characters left before I hit the 140 limit.

This basically renders web intents useless for sites that do lots of funky stuff in the URL fragment without going through a third-party shortener first. Help!


#2

Thanks for reporting this; I’ll ask the responsible team if there’s anything we can do about this.


#3

Thanks, Taylor. I appreciate the speedy response.


#4

#5

#6