Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/390.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Ckeditor自动删除样式css_Javascript_Html_Ckeditor_Ckeditor5 - Fatal编程技术网

Javascript Ckeditor自动删除样式css

Javascript Ckeditor自动删除样式css,javascript,html,ckeditor,ckeditor5,Javascript,Html,Ckeditor,Ckeditor5,我用 <div class="document-editor" runat="server" visible="false" id="editor_pnl"> <div class="document-editor__toolbar"></div> <div class="document-editor__editable-container"> <div class="document

我用

<div class="document-editor" runat="server" visible="false" id="editor_pnl">
        <div class="document-editor__toolbar"></div>
        <div class="document-editor__editable-container">
            <div class="document-editor__editable" id="editor1" runat="server">
            </div>
        </div>
        <asp:Button ID="btn_save_statement" runat="server" Text="Save" CssClass="btn btn-primary" OnClientClick="GetEditorData();" OnClick="btn_save_statement_Click" />
    </div>

<script>
    DecoupledEditor
        .create(document.querySelector('.document-editor__editable'), {

        })
        .then(editor => {
            const toolbarContainer = document.querySelector('.document-editor__toolbar');

            toolbarContainer.appendChild(editor.ui.view.toolbar.element);
            config.allowedContent = true;
            window.editor = editor;
        })
        .catch(err => {
            console.error(err);
        });

    function GetEditorData() {
        document.getElementById('<%= hf_edit.ClientID %>').value = document.getElementById('ContentPlaceHolder1_UC_HR_editor1').innerHTML;
        document.getElementById('<%= hf_edit.ClientID %>').value.replace('<div data-cke-hidden-sel="1" data-cke-temp="1" style="position:fixed;top:0;left:-1000px;width:0;height:0;overflow:hidden;">hcard widget</div>', '');
    }
</script>
config.allowedContent =
    'h1 h2 h3 p blockquote strong em;' +
    'a[!href];' +
    'img(left,right)[!src,alt,width,height];';