Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Strange auto-linking behaviour on invalid length @usernames #49

Open
wants to merge 2 commits into from

1 participant

@cameronhunter
Collaborator

I think it's strange behaviour to auto-link prefixes of invalid length usernames. For example a tweet containing @username9012345678901 would become <a href="https://twitter.com/username901234567890">username901234567890</a>1.

I saw this happen in the wild and thought it looked broken. The tweet links to something that user didn't expect it to.

weird auto link behaviour on usernames

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 7, 2012
  1. @cameronhunter
  2. @cameronhunter

    Same issue with invalid list names. We should just autolink the usern…

    cameronhunter authored
    …ame (if valid). Autolinking a prefix of something known to be invalid is weird.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 autolink.yml
View
4 autolink.yml
@@ -50,7 +50,7 @@ tests:
- description: "DO NOT Autolink username over 20 characters"
text: "@username9012345678901"
- expected: "@<a class=\"tweet-url username\" href=\"https://twitter.com/username901234567890\">username901234567890</a>1"
+ expected: "@username9012345678901"
- description: "Autolink two usernames"
text: "@foo @bar"
@@ -95,7 +95,7 @@ tests:
- description: "Autolink list name over 25 characters (truncated to 25)"
text: "@username/list567890123456789012345A"
- expected: "@<a class=\"tweet-url list-slug\" href=\"https://twitter.com/username/list567890123456789012345\">username/list567890123456789012345</a>A"
+ expected: "@<a class=\"tweet-url username\" href=\"https://twitter.com/username\">username</a>/list567890123456789012345A"
- description: "Autolink list that contains an _"
text: "text @username/list_name"
Something went wrong with that request. Please try again.