简体   繁体   English

TinyMCE自定义元素带有':'吗?

[英]TinyMCE Custom Elements with a ' : '?

So I'm looking to allow Thymeleaf tags inside my TinyMce Editor (using angular-ui-tinymce if that matters) 因此,我希望在TinyMce编辑器中允许Thymeleaf标签(如果需要的话,可以使用angular-ui-tinymce)

I understand the basic format 我了解基本格式

 extended_valid_elements : 'script[charset|language|type|src]'

but how would I use this to allow for things like 但是我将如何使用它来允许类似

 <p th:text="..."> //or// <img th:src="..."/>

Before anyone asks, yes it is necessary to have both tinyMce and thymeleaf, and No I don't need the thymeleaf to work inside tinymce, I just need the editor to stop stripping the tags. 在有人问之前,是的,有必要同时包含tinyMce和thymeleaf,并且不,我不需要thymeleaf在tinymce中工作,我只需要编辑器停止剥离标签即可。

尝试将其放入您的TinyMCE配置中:

valid_elements: "*[*]"
extended_valid_elements : 'img[th::text]'

Double colon symbol works as a single ':' char, but unfortunately you can't add attribute to * (any element) in extended_valid_elements. 双冒号符号可以作为单个':'字符使用,但是很遗憾,您不能在extended_valid_elements中将属性添加到*(任何元素)中。 But you can list all needed elements. 但是您可以列出所有需要的元素。

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

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