【发布时间】:2020-07-27 22:03:02
【问题描述】:
我正在尝试使用自定义按钮插入一些自定义 html,效果如下:
editor.selection.setContent('<a href="example.com">Custom Link</a>
但是当您尝试插入自定义标签时,单击自定义按钮时它什么也不做:
editor.selection.setContent('<custom-link href="example.com">Custom Link</custom-link>
我认为问题在于 tinymce 正在清理我的自定义标签 (docs)。
我还可以在上面的文档中看到您可以传递 setContent 一个 args 对象,但我看不到您实际上可以传递哪些 args。
基本上 - 我怎样才能让 tinymce 允许我插入自定义 html 标签?我认为可能是传入了一个参数,但我不确定。
【问题讨论】: