1

当我从 Word 粘贴复制的表格时,我会得到一个带有影响布局的段落标签的表格。我尝试<p>使用 valid_children 选项删除标签,但这似乎不起作用。

当我粘贴时,我会得到这个:

<table>
<tbody>
<tr>
<td>
<p><strong>Content</strong></p>
</td>

但我想要这个:

<table>
<tbody>
<tr>
<td>
<strong>Content</strong>
</td>

设置:

selector: '#editor',
min_height: 555,
plugins: 'anchor autolink autoresize charmap code directionality fullscreen image imagetools link lists nonbreaking paste searchreplace table visualblocks visualchars',
menubar: false,
toolbar: 'undo redo | cut copy paste pastetext | formatselect | bold italic | alignleft aligncenter alignright | bullist numlist indent outdent | table anchor link image | removeformat charmap visualblocks searchreplace fullscreen code',
block_formats: 'Paragraph=p;Heading 2=h2',
language:  'nl',
statusbar: false,
anchor_top: false,
anchor_bottom: false,
paste_enable_default_filters: true,
paste_word_valid_elements: "p,b,strong,i,em,u,h2,a[href],ol,ul,li,table,tr,td,th,tbody,thead",
paste_retain_style_properties: "",
verify_html: true,
valid_children: "-td[p]",
4

0 回答 0