首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TinyMCE和Piranha不允许我将<style>标记设置为有效元素:(

TinyMCE和Piranha不允许我将<style>标记设置为有效元素:(
EN

Stack Overflow用户
提问于 2021-07-23 22:55:53
回答 1查看 240关注 0票数 0

我试图在这里添加//自定义css到微小的mce编辑器中,但目前它删除了样式标记和保存时它们之间的任何东西。我试图设置valid_elements:"style“和/或custom_elements:"sabioStyle”和/或extended_valid_elements:"style“。我也试过:"[]“根据tiny的文档,但它似乎对任何事情都没有影响。我看到init功能:

代码语言:javascript
复制
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使用sets extended_valid_elements: piranha.editorconfig.extended_valid_elements,但是我的开发工具没有显示我在editorconfig.json中键入的值.

editorconfig.json devTools

我试过了他们的医生说的每一件事,我也有一个关于Piranha的github的问题。任何建议都会很好!谢谢

EN

回答 1

Stack Overflow用户

发布于 2021-07-24 18:54:51

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68505725

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档