Changeset 635 for confluence

Show
Ignore:
Timestamp:
08/07/09 12:14:31 (12 months ago)
Author:
confluence
Message:

bugfix: anchors formatted as tags

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • confluence/feedfilters/twitterfilter.py

    r587 r635  
    1919linkurls = re.compile(r"(https?://[^ ]*)") 
    2020linknames = re.compile(r"@([a-zA-Z0-9_]+)") 
    21 hashtags = re.compile(r"#([a-zA-Z0-9_]+)") 
     21hashtags = re.compile(r"(^| )#([a-zA-Z0-9_]+)") 
    2222statusidpattern = re.compile(r"http://twitter.com/.*/statuses/([0-9]*)") 
    2323 
     
    4343    text = linkurls.sub(r"<a href='\1'>\1</a>", text) 
    4444    text = linknames.sub(r"<a href='http://twitter.com/\1'>@\1</a>", text) 
    45     text = hashtags.sub(r"<a href='http://search.twitter.com/search?q=%23\1'>#\1</a>", text) 
     45    text = hashtags.sub(r"\1<a href='http://search.twitter.com/search?q=%23\1'>#\2</a>", text) 
    4646    text += " <a href='http://twitter.com/home?status=@%s%%20&in_reply_to_status_id=%s&in_reply_to=%s'>Reply</a>" % (username, statusid, username) 
    4747    description.data = text