600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > html 链接nofollow ueditor给超链接默认添加rel=nofollow标签

html 链接nofollow ueditor给超链接默认添加rel=nofollow标签

时间:2019-12-28 23:29:45

相关推荐

html 链接nofollow ueditor给超链接默认添加rel=nofollow标签

由于百度的seo规则,越来越多的站长开始重视rel="nofollow"功能了。并且由于ueditor的强大功能与免费的特性,渐渐也成为了众多屌丝站长的首选网站编辑器。

但是由于ueditor本身并不自带rel="nofollow"功能,因此默认情况下,如果要引入其他站点的链接,就会导致自己的网站权重下降。如果能修改代码,让ueditor的link自带rel="nofollow"就好了。现在我就来教大家怎么改。

话不多说,直接上补丁。diff--gita/ueditor/dialogs/link/link.htmlb/ueditor/dialogs/link/link.html

index55ab4d1..cce7ec8100644

---a/ueditor/dialogs/link/link.html

+++b/ueditor/dialogs/link/link.html

@@-79,6+79,7@@

'href':href,

'target':$G("target").checked?"_blank":'_self',

'title':$G("title").value.replace(/^\s+|\s+$/g,''),

+'rel':'nofollow',

'_href':href

};

//修改链接内容的情况太特殊了,所以先做到这里了

diff--gita/ueditor/ueditor.config.jsb/ueditor/ueditor.config.js

indexacacc9d..e1dce7e100644

---a/ueditor/ueditor.config.js

+++b/ueditor/ueditor.config.js

@@-363,7+363,7@@

,outputXssFilter:true

//xss过滤白名单名单来源:/leizongmin/js-xss/master/lib/default.js

,whitList:{

-a:['target','href','title','class','style'],

+a:['target','href','title','class','style','rel'],

abbr:['title','class','style'],

address:['class','style'],

area:['shape','coords','href','alt'],

简单的说就是修改两个文件。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。