pbootcms百度编辑器UEDITOR给超链接默认添加rel="nofollow"标签
为了让 PbootCMS 的 UEditor 编辑器给超链接默认添加 rel="nofollow"
标签,你需要按照以下步骤进行修改。
步骤 1: 修改 link.html
文件
-
定位文件:
- 找到
core/extend/ueditor/dialogs/link/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
文件。
- 找到
-
修改第 370 行:
- 将原有的代码:
javascript
a: ['target', 'href', 'title', 'class', 'style','name','id'], abbr: ['title', 'class', 'style'], abbr: ['title', 'class', 'style'], area: ['shape', 'coords', 'href', 'alt'],
- 修改为:
javascript
a: ['target', 'href', 'title', 'class', 'style','name','rel','id'], abbr: ['title', 'class', 'style'], abbr: ['title', 'class', 'style'], area: ['shape', 'coords', 'href', 'alt'],
- 将原有的代码:
扫码添加技术【解决问题】
专注中小企业网站建设、网站安全12年。
熟悉各种CMS,精通PHP+MYSQL、HTML5、CSS3、Javascript等。
承接:企业仿站、网站修改、网站改版、BUG修复、问题处理、二次开发、PSD转HTML、网站被黑、网站漏洞修复等。
专业解决各种疑难杂症,您有任何网站问题都可联系我们技术人员。
本文来自博客园,作者:黄文Rex,转载请注明原文链接:https://www.cnblogs.com/hwrex/p/18447016
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步