From 4174e5f85c9dbb23a35f8380e88065eb7dbd429c Mon Sep 17 00:00:00 2001 From: taggon Date: Wed, 9 Dec 2009 04:48:46 +0000 Subject: [PATCH] =?UTF-8?q?#18533379=20localhost=20=EB=8F=84=20=EA=B7=9C?= =?UTF-8?q?=EC=B9=99=EC=97=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7018 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- addons/autolink/autolink.js | 4 ++-- addons/autolink/autolink.spec.html | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/autolink/autolink.js b/addons/autolink/autolink.js index eb42dd39c..4b3939ebd 100644 --- a/addons/autolink/autolink.js +++ b/addons/autolink/autolink.js @@ -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 : [], diff --git a/addons/autolink/autolink.spec.html b/addons/autolink/autolink.spec.html index bd57922e0..670a0a502 100644 --- a/addons/autolink/autolink.spec.html +++ b/addons/autolink/autolink.spec.html @@ -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~ IP Test http://119.205.243.46 and MMS Link mms://xpressengine.com/a.wmv + http://localhost/some/path/file.ext Is it OK?
http://mygony.com