简体   繁体   English

ckeditor5中没有编辑气球的链接

[英]Link without edit balloon in ckeditor5

I used CKEditor5 with Reactjs, I want to add the link without editing, I actually want to see the creation balloon once and it is at the time of creation Then on clicking the link, without the 'editi balloon', to be directed to a specific target.我将CKEditor5与Reactjs一起使用,我想添加链接而不进行编辑,我实际上想查看一次创建气球,它是在创建时然后单击链接,没有“编辑气球”,被定向到具体目标。 is that possible or I have to handle it with css and js code?这是可能的还是我必须用 css 和 js 代码来处理它?

After a few days I was able to find a solution, I hope it is useful for someone else I added contenteditable:'false' in attributes of the Link and my problem has solved When the link is not editable, it is displayed without balloons几天后我找到了解决方案,我希望它对其他人有用我在链接的属性中添加了 contenteditable:'false' 并且我的问题已经解决了当链接不可编辑时,它显示为没有气球

 <CKEditor
            disabled={!this.state.isOrganizer}
              editor={ClassicEditor}
              data={this.state.Message}
              config={{
                toolbar: ['heading', '|', 'bold', 'italic', 'blockQuote', 'link', 'numberedList', 'bulletedList', 'imageUpload', 'insertTable',
                  'tableColumn', 'tableRow', 'mergeTableCells', 'mediaEmbed', '|', 'undo', 'redo'],
                language: 'de',
                link: {
                  decorators: {
                      addTargetToExternalLinks: {
                          mode: 'automatic',
                          callback: url => /^(https?:)?\/\//.test( url ),
                          attributes: {
                              target: '_blank',
                              rel: 'noopener noreferrer',
                              contenteditable:'false' //<=========== solution***
                          }
                      }
                  }
                }
              }}
              onChange={(event, editor) => {
                const data = editor.getData();
                this.setState({
                  Message: data
                }, () => {
                   
                })
              }}
            />

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

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