允许 TinyMCE 中的自定义标签与 indexhibit 集成
我正在尝试允许将一些自定义标签输入到 TinyMCE 中。标签是
<plug:plugin_name />
然而这变成了
<plug:plugin_name></plug:plugin_name>
我即将编写一个正则表达式来处理这个问题,因为我必须完成工作,我真的不想这样做,但它会解决我的问题。
我已经尝试了许多初始化选项:
extended_valid_elements : "plug.plugin_name[*]",
custom_elements: "plug.plugin_name[*]",
verify_html : false, **//This ment that the tag wasn't ouright removed**
selfclosetags : \" />\", //some plugin I found, didn't seem to work
closed : /^(br|hr|input|meta|img|link|param|area|plug:plugin_name)$/,
还有其他人肯定能让它与最新版本的 TinyMCE 一起使用吗?
另外,另一个问题是,在我用正则表达式修复它之后,编辑器会删除标签!
I'm trying to allow some custom tags to be entered into TinyMCE. The tag is
<plug:plugin_name />
However this is turned into
<plug:plugin_name></plug:plugin_name>
I'm about to write a regex to deal with this as I have to get the job done, I'd really rather not, but it will fix my issue.
I've tried many of the init options:
extended_valid_elements : "plug.plugin_name[*]",
custom_elements: "plug.plugin_name[*]",
verify_html : false, **//This ment that the tag wasn't ouright removed**
selfclosetags : \" />\", //some plugin I found, didn't seem to work
closed : /^(br|hr|input|meta|img|link|param|area|plug:plugin_name)$/,
Anyone else definitely got this to work with a recent version of TinyMCE?
Also, another problem will be the editor will strip away the tag, after I have fixed it with the regex!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您只需将其添加到短结束元素列表中即可:
这是一个用于演示的 fiddle 。
You just need to add it to the list of short ended elements:
Here's a fiddle to demonstrate.
而不是:
这有效吗?
请注意最后一项“plug”不带 : 修饰符。
Instead of:
Does this work?
Note the last item "plug" without the : modifier.
您尝试过这个选项吗?
Have you tried this option?
首先让我们为您的 Tinymce 4 编辑器创建一个自定义插件。然后为此插件添加一个菜单项:
您已经完成了自定义插件和自定义菜单项的创建,让我们将其实际添加到 Tinymce 4 编辑器中。这将在tinymce.init方法中完成:
First lets create a custom plugin for your Tinymce 4 editor.and then add a menu item for this plugin:
you are done creating your custom plugin and custom menu items, lets actually add it to the Tinymce 4 editor. This will be done in the tinymce.init method:
您可以将编码方法用作任何类型数据的原始编码。
You can use encoding method as raw for any type of data.