Changeset 894


Ignore:
Timestamp:
10/08/07 22:49:23 (11 years ago)
Author:
ray
Message:
  • #1083 Convert URLs to links - Error
  • #1084 URL auto-linking (Gecko): URLs with user:password@domain.tld falsely recognized as email address
  • #1085 URL auto-linking (Gecko): IP numbers don't work
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r893 r894  
    457457* @type RegExp 
    458458*/ 
    459 Xinha.RE_email    = /[_a-z\d\-\.]{3,}@[_a-z\d\-]{2,}(\.[_a-z\d\-]{2,})+/i; 
     459Xinha.RE_email    = /^[_a-z\d\-\.]{3,}@[_a-z\d\-]{2,}(\.[_a-z\d\-]{2,})+$/i; 
    460460/** Identifies URLs 
    461461* @type RegExp 
  • trunk/modules/Gecko/Gecko.js

    r808 r894  
    167167          if (RE_date.test(matchData)) 
    168168          { 
    169             if (!RE_ip.test(matchData))  
     169            break; //ray: disabling linking of IP numbers because of general bugginess (see Ticket #1085) 
     170                        /*if (!RE_ip.test(matchData))  
    170171            { 
    171172              break; 
    172             } 
     173            }*/ 
    173174          }  
    174175          var leftTextUrl  = s.anchorNode; 
     
    255256 
    256257            var m = s.anchorNode.data.match(Xinha.RE_url); 
    257             if ( m && a.href.match(s.anchorNode.data.trim()) ) 
     258                         
     259            if ( m && a.href.match(new RegExp( 'http(s)?://' + Xinha.escapeStringForRegExp( s.anchorNode.data.trim() ) ) ) ) 
    258260            { 
    259261              var txtNode = s.anchorNode; 
     
    261263              { 
    262264                // Sometimes m is undefined becase the url is not an url anymore (was www.url.com and become for example www.url) 
     265                                // ray: shouldn't the link be un-linked then? 
    263266                m = txtNode.data.match(Xinha.RE_url); 
    264267                if(m) 
Note: See TracChangeset for help on using the changeset viewer.