Closed willwade closed 9 years ago
needs something like:
twitter_username_re = re.compile(?<=^|(?<=[^a-zA-Z0-9-\\.]))@([A-Za-z]+[A-Za-z0-9]+) my_html_str = twitter_username_re.sub(lambda m: '<a href="http://twitter.com/%s">%s</a>' % (m.group(1), m.group(0)), my_tweet)
if space in twitter then break the link.. e.g.:
@willwade (via Ian Hamilton on the games access list)
currently gets a href wrapping the whole line. It needs to break before the space (i.e. after willwade)