Changeset 36297

Show
Ignore:
Timestamp:
12/29/09 03:16:52 (3 years ago)
Author:
NeoCat
Message:

skip link while searching hashtag

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • websites/twicli/search.js

    r36077 r36297  
    6868                        var target = eles[i]; 
    6969                        if (target.className == "status") { 
    70                                 target.innerHTML = target.innerHTML.replace(/([\u0001-\/:-@\[-`{-~]|^)(\#[0-9A-Za-z_]{2,})(?=[\u0001-\/:-@\[-`{-~]|$)/g, function(_,d1,t){ 
     70                                target.innerHTML = target.innerHTML.replace(/<a .*?>.*?<\/a>|([\u0001-\/:-@\[-`{-~]|^)(\#[0-9A-Za-z_]{2,})(?=[\u0001-\/:-@\[-`{-~]|$)/g, function(_,d1,t){ 
     71                                        if (_.substr(0,1) == '<') return _; // skip link 
    7172                                        if (t.match(/^#\d+$/)) return d1+t; 
    7273                                        return d1+'<a href="javascript:twsSearch(\''+t+'\')">'+t+'</a>';