mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
#18642837 자동링크에서 사용자 경로(domain.com/~user)를 정상적으로 처리하지 못하던 버그 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7241 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
bd317e765d
commit
4eaeba6aa5
2 changed files with 7 additions and 1 deletions
|
|
@ -9,10 +9,11 @@
|
|||
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 user_re = '(?:/~[\\w-]+)?';
|
||||
var path_re = '((?:/[\\w!"$-/:-@]+)*)';
|
||||
var hash_re = '(?:#([\\w!-@]+))?';
|
||||
|
||||
var url_regex = new RegExp('('+protocol_re+'('+domain_re+'|'+ip_re+'|localhost'+')'+port_re+path_re+hash_re+')', 'ig');
|
||||
var url_regex = new RegExp('('+protocol_re+'('+domain_re+'|'+ip_re+'|localhost'+')'+port_re+user_re+path_re+hash_re+')', 'ig');
|
||||
|
||||
var AutoLink = xe.createPlugin("autolink", {
|
||||
targets : [],
|
||||
|
|
|
|||
|
|
@ -60,6 +60,10 @@ describe('AutoLink functionality', {
|
|||
"#test9 - don't include parenthesis" : function() {
|
||||
value_of( $('#test9 a').length ).should_be(1);
|
||||
value_of( $('#test9 a').attr('href') ).should_be('http://www.naver.com');
|
||||
},
|
||||
"#test10 - include tild" : function() {
|
||||
value_of( $('#test10 a').length ).should_be(1);
|
||||
value_of( $('#test10 a').attr('href') ).should_be('http://www.xpressengine.com:8000/~user/?mid=def');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -102,6 +106,7 @@ describe('Autolink trigger', {
|
|||
<div id="test7">http://mygony.com</div>
|
||||
<div id="test8">Go to http://mygony.com</div>
|
||||
<div id="test9">Naver(http://www.naver.com)</div>
|
||||
<div id="test10">User homepage : http://www.xpressengine.com:8000/~user/?mid=def should be a link.</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue