如何将微数据插入tinymce 5x

问题描述

大家好,新年快乐!

我正在使用 Tinymce 5x,但在使用编辑器输出有效的 html5 + 微数据时遇到了大问题。 这是我初始化编辑器的方式:

tinymce.init({
                    selector: 'textarea.editors',schema: 'html5',extended_valid_elements : "@[itemtype|itemscope|itemprop|id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouSEOver|onmousemove|onmouSEOut|onkeypress|onkeydown|onkeyup]",plugins: 'print preview fullpage paste importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable help charmap quickbars emoticons',imagetools_cors_hosts: ['picsum.photos'],menubar: 'file edit view insert format tools table help',toolbar: 'undo redo | bold italic underline strikethrough | image toc visualblocks | fontselect fontsizeselect formatselect | outdent indent |  numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen  preview save print | insertfile image media template link anchor codesample | ltr rtl',toc_depth: 4,toolbar_sticky: true,autosave_ask_before_unload: true,autosave_interval: "30s",autosave_prefix: "{path}{query}-{id}-",autosave_restore_when_empty: false,autosave_retention: "2m",image_advtab: true,relative_urls : false,remove_script_host : true,document_base_url : "https://www.example.com/",external_image_list_url : "process.PHP?basics=media_img_list",content_css: [
                        '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i','//www.tiny.cloud/css/codepen.min.css'
                    ],importcss_append: true,height: 300,height: 500,image_caption: true,quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',noneditable_noneditable_class: "mceNonEditable",toolbar_drawer: 'sliding',contextmenu: "link image imagetools table",style_formats: [
                        { title: 'Citation',block: 'div',classes: 'quotation' },]
                });

现在我想输出的是:

<section itemscope itemtype="http://schema.org/Question">
  <h2 itemprop="name text">My Question</h2>
  <div itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <p itemprop="text">My Answer</p>
  </div>
</section>

但是当我用 HTML 编辑器保存它时,所有属性都被剥离,当我将它发送到我的 PHP 文件时,它会剥离部分标签

你能帮我解决这个问题吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...