【发布时间】:2021-07-23 22:55:53
【问题描述】:
我正在尝试将 添加到微型 mce 编辑器中,但目前它会在保存时删除样式标签以及它们之间的任何内容。 我正在尝试设置valid_elements:“style”和/或custom_elements:“sabioStyle”和/或extended_valid_elements:“style”。我也尝试过:“[]”,根据 tiny 的文档,但它似乎对任何东西都没有影响。我看到init函数:
piranha.editor.addInline = function (id, toolbarId) {
tinymce.init({
selector: "#" + id,
browser_spellcheck: true,
fixed_toolbar_container: "#" + toolbarId,
menubar: false,
branding: false,
statusbar: false,
inline: true,
convert_urls: false,
plugins: [
piranha.editorconfig.plugins
],
width: "100%",
autoresize_min_height: 0,
toolbar: piranha.editorconfig.toolbar,
extended_valid_elements: piranha.editorconfig.extended_valid_elements,
block_formats: piranha.editorconfig.block_formats,
style_formats: piranha.editorconfig.style_formats,
file_picker_callback: function(callback, value, meta) {
// Provide file and text for the link dialog
if (meta.filetype == 'file') {
piranha.mediapicker.openCurrentFolder(function (data) {
callback(data.publicUrl, { text: data.filename });
}, null);
}
// Provide image and alt text for the image dialog
if (meta.filetype == 'image') {
piranha.mediapicker.openCurrentFolder(function (data) {
callback(data.publicUrl, { alt: "" });
}, "image");
}
}
});
$("#" + id).parent().append("<a class='tiny-brand' href='https://www.tiny.cloud' target='tiny'>Powered by Tiny</a>");
};
Piranha 使用集合 extended_valid_elements: piranha.editorconfig.extended_valid_elements 但我的开发工具没有显示我在 editorconfig.json 中键入的值...
我已经尝试了他们的文档所说的一切,我在 github 上也有一个关于 Piranha 的问题。任何建议都会很棒!谢谢
【问题讨论】:
标签: tinymce piranha-cms