17596244 * autolink 애드온 추가 문제 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5201 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
bnu 2009-01-02 13:11:58 +00:00
parent e8198a4381
commit 816c6f45ce

View file

@ -5,7 +5,7 @@ jQuery(function($) {
function replaceHrefLink(obj) {
var obj_list = obj.childNodes;
for(var i=0; i < obj_list.length; ++i) {
for(var i = 0; i < obj_list.length; ++i) {
var obj = obj_list[i];
var pObj = obj.parentNode;
if(!pObj) continue;
@ -15,14 +15,16 @@ jQuery(function($) {
if(obj.nodeType == 3 && obj.length >= 10) {
var content = obj.nodeValue;
content = content.replace('<', '&lt;');
content = content.replace('>', '&gt;');
if(!url_regx.test(content)) continue;
content = content.replace(/</g, '&lt;');
content = content.replace(/>/g, '&gt;');
content = content.replace(url_regx, '<a href="$1" onclick="window.open(this.href); return false;">$1</a>');
$(obj).replaceWith(content);
delete(content);
} else if(obj.nodeType == 1 && obj.childNodes.length) {
if($.inArray(obj.nodeName.toLowerCase(), ['a', 'pre', 'xml', 'textarea', 'input', 'option', 'code']) != -1) continue;
replaceHrefLink(obj);
}
}