mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
17596244 * autolink 애드온 추가 문제 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5201 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e8198a4381
commit
816c6f45ce
1 changed files with 6 additions and 4 deletions
|
|
@ -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('<', '<');
|
||||
content = content.replace('>', '>');
|
||||
if(!url_regx.test(content)) continue;
|
||||
|
||||
content = content.replace(/</g, '<');
|
||||
content = content.replace(/>/g, '>');
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue