Skip to content
This repository

Isolated @ should not be link-converted #374

Closed
su opened this Issue · 6 comments

4 participants

Su Gina Trapani Finn Smith Sutherland Boswell
Su
su commented

In we have an Twitter update in the form eg. "If you [whatever] @ me with information" the @ gets linked to a null username(and so the Twitter homepage).

Finn Smith

Same question as in #373

Is there some sort of official document on twitter's dev site or elsewhere which details the proper regexp or pattern for capturing legal twitter usernames?

Finn Smith

Discussion of Twitter text libs here:

http://engineering.twitter.com/2010/02/introducing-open-source-twitter-text.html

From a brief readthrough it looks like the best thing to do would be to rely on the Twitter-supplied PHP and text conformance. Here and here:

http://github.com/mzsanford/twitter-text-php
http://github.com/mzsanford/twitter-text-conformance

Finn Smith

Whoops, the most active repo is here:

http://github.com/ngnpope/twitter-text-php

Sutherland Boswell

Fixed Twitter username link bugs

  • Doesn't link isolated @ symbols
  • Fixed links to usernames surrounded by parentheses
  • Fixed links to usernames starting with a .
  • Simplified the replacement of usernames using a regex
  • Added test cases for each to assert links are correct
  • Closed by 33f9831, Closed by 33f9831, Closed by 33f9831, Closed by 33f9831, Closed by 33f9831
Ruthie BenDor unruthless referenced this issue from a commit in unruthless/ThinkUp
Sutherland Boswell suth Fixed Twitter username link bugs
* Doesn't link isolated @ symbols
* Fixed links to usernames surrounded by parentheses
* Fixed links to usernames starting with a .
* Simplified the replacement of usernames using a regex
* Added test cases for each to assert links are correct
* Closes #373, Closes #374, Closes #375, Closes #381, Closes #543
33f9831
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.