如何在PbootCMS的百度编辑器UEditor中给超链接默认添加 rel="nofollow" 标签?

为了在PbootCMS中使用百度编辑器UEditor时,让所有插入的超链接默认添加 rel="nofollow" 标签,您需要修改两个文件:link.html 和 ueditor.config.js。以下是详细的步骤和说明:

步骤1:修改 link.html

  1. 找到文件

    • 文件路径:/core/extend/ueditor/dialogs/link/link.html
  2. 编辑文件

    • 打开 link.html 文件。

    • 找到第81行左右的代码段,通常如下所示:

      javascript
       
      'href' : href, 'target' : $G("target").checked ? "_blank" : '_self', 'title' : $G("title").value.replace(/^\s+|\s+$/g, ''), '_href':href
  3. 修改代码

    • 将上述代码段修改为:

      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

  1. 找到文件

    • 文件路径:/core/extend/ueditor/ueditor.config.js
  2. 编辑文件

    • 打开 ueditor.config.js 文件。

    • 找到第370行左右的代码段,通常如下所示:

      javascript
       
      a: ['target', 'href', 'title', 'class', 'style','name','id'], abbr: ['title', 'class', 'style'], area: ['shape', 'coords', 'href', 'alt'],
  3. 修改代码

    • 将上述代码段修改为:

      javascript
       
      a: ['target', 'href', 'title', 'class', 'style','name','rel','id'], abbr: ['title', 'class', 'style'], area: ['shape', 'coords', 'href', 'alt'],
posted @   黄文Rex  阅读(9)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示