如何在PbootCMS的百度编辑器UEditor中给超链接默认添加 rel="nofollow" 标签?
为了在PbootCMS中使用百度编辑器UEditor时,让所有插入的超链接默认添加 rel="nofollow"
标签,您需要修改两个文件:link.html
和 ueditor.config.js
。以下是详细的步骤和说明:
步骤1:修改 link.html
-
找到文件:
- 文件路径:
/core/extend/ueditor/dialogs/link/link.html
- 文件路径:
-
编辑文件:
-
打开
link.html
文件。 -
找到第81行左右的代码段,通常如下所示:
javascript'href' : href, 'target' : $G("target").checked ? "_blank" : '_self', 'title' : $G("title").value.replace(/^\s+|\s+$/g, ''), '_href':href
-
-
修改代码:
-
将上述代码段修改为:
javascript'href' : href, 'target' : $G("target").checked ? "_blank" : '_self', 'title' : $G("title").value.replace(/^\s+|\s+$/g, ''), 'rel': 'nofollow', '_href':href
-
步骤2:修改 ueditor.config.js
-
找到文件:
- 文件路径:
/core/extend/ueditor/ueditor.config.js
- 文件路径:
-
编辑文件:
-
打开
ueditor.config.js
文件。 -
找到第370行左右的代码段,通常如下所示:
javascripta: ['target', 'href', 'title', 'class', 'style','name','id'], abbr: ['title', 'class', 'style'], area: ['shape', 'coords', 'href', 'alt'],
-
-
修改代码:
-
将上述代码段修改为:
javascripta: ['target', 'href', 'title', 'class', 'style','name','rel','id'], abbr: ['title', 'class', 'style'], area: ['shape', 'coords', 'href', 'alt'],
-
扫码添加技术【解决问题】
专注企业网站建设、网站安全16年。
承接:企业网站建设、网站修改、网站改版、BUG修复、问题处理、二次开发、PSD转HTML、网站被黑、网站漏洞修复等。
专业解决各种疑难杂症,您有任何网站问题都可联系我们技术人员。
本文来自博客园,作者:黄文Rex,转载请注明原文链接:https://www.cnblogs.com/hwrex/p/18580516