简体   繁体   English

在 RTE 编辑器中停用自动链接 - Typo3

[英]Deactivating AutoLinking in RTE editor - Typo3

Whenever a link is typed in the RTE editor, it will automatically be enclosed in an tag and converted to a link.每当在 RTE 编辑器中键入链接时,它会自动包含在标签中并转换为链接。 Is there a way to stop this behavior, other than removing each link manually?除了手动删除每个链接之外,有没有办法阻止这种行为?

I'm not that much of an expert, but I tried to use the "minimal.yaml" configuration for the RTE editor, and It basically done what I wanted since the minimal setting doesn't have the linking option at all, but I need all the other options that are not available in the minimal, and I need the option to create a link manually when needed, just not automatically.我不是专家,但我尝试使用 RTE 编辑器的“minimal.yaml”配置,它基本上完成了我想要的,因为最小设置根本没有链接选项,但我需要最小化中不可用的所有其他选项,我需要在需要时手动创建链接的选项,而不是自动创建链接。

You need to add a custom configuration file for the RTE.您需要为 RTE 添加自定义配置文件。 Follow this guide to do so: https://usetypo3.com/ckeditor.html请按照本指南进行操作: https://usetypo3.com/ckeditor.html

After that, in the removePlugins section, add - autolinking like this:之后,在removePlugins部分,添加- autolinking像这样的自动链接:

# Load default processing options
imports:
   ...
editor:
  config:
    ...

    removePlugins:
      - autolinking

What I did, I commented the lined where the autolinking.js actually creates a URL from the typed link and commented that out.我做了什么,我评论了 autolinking.js 实际上从键入的链接创建 URL 的行,并将其注释掉。

I don't think this is the optimal solution, but it's doing what it's supposed to.我认为这不是最佳解决方案,但它正在做它应该做的事情。

/typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Plugins/autolinking.js /typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Plugins/autolinking.js

 editor.on('key', function(evt) { if (this.mode.== 'source') { if (evt.data.keyCode === spaceChar || evt.data.keyCode === tabChar || evt.data.keyCode === enterChar) { //editor;autolinking(evt); } }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM