#18533379 localhost 도 규칙에 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7018 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2009-12-09 04:48:46 +00:00
parent a5bae0fb01
commit 4174e5f85c
2 changed files with 4 additions and 3 deletions

View file

@ -6,13 +6,13 @@
(function($){
var protocol_re = '(https?|ftp|news|telnet|irc|mms)://';
var domain_re = '(?:[\\w\\-]+\\.)+(?:[a-z]+)';
var max_255_re = '(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]?)';
var max_255_re = '(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])';
var ip_re = '(?:'+max_255_re+'\\.){3}'+max_255_re;
var port_re = '(?::([0-9]+))?';
var path_re = '((?:/[\\w!"$-/:-@]+)*)';
var hash_re = '(?:#([\\w!-@]+))?';
var url_regex = new RegExp('('+protocol_re+'('+domain_re+'|'+ip_re+')'+port_re+path_re+hash_re+')', 'ig');
var url_regex = new RegExp('('+protocol_re+'('+domain_re+'|'+ip_re+'|localhost'+')'+port_re+path_re+hash_re+')', 'ig');
var AutoLink = xe.createPlugin("autolink", {
targets : [],

View file

@ -51,7 +51,7 @@ describe('AutoLink functionality', {
value_of( $('#test5').contents().length ).should_be(3);
},
"#test6 - complex example" : function() {
value_of( $('#test6 a').length ).should_be(6);
value_of( $('#test6 a').length ).should_be(7);
value_of( $('#test6 a').eq(0).attr('href') ).should_be($('#test6 a').eq(0).text());
value_of( $('#test6 a').eq(2).parent().is('b') ).should_be_true();
value_of( $('#test6 > textarea > a').length ).should_be(0);
@ -95,6 +95,7 @@ describe('Autolink trigger', {
Sayonara~
</div>
IP Test http://119.205.243.46 and MMS Link mms://xpressengine.com/a.wmv
http://localhost/some/path/file.ext
Is it OK?
</div>
<div id="test7">http://mygony.com</div>