将ckeditor数据保存到数据库

时间:2019-02-14 18:48:56

标签: php ckeditor styles

我在将ckeditor HTML内容保存到数据库时遇到问题。这是应该保存的

<h2 dir="rtl" style="text-align:center"><strong></strong></h2>
<table border="1" cellpadding="10" cellspacing="0" style="width:100%">
<tbody>
    <tr>
        <td colspan="2" dir="rtl" style="background-color:#99cc66">
            <strong><span style="font-size:20px">:</span></strong>
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</tbody>
</table>

这是html ckeditor

中的来源textarea

但是在发送postvar_dump($_POSt)之后,它看起来像:

<h2 dir="rtl" [removed]="width:100%">
<tbody>
<tr>
 <td colspan="2" dir="rtl" [removed]="font-size:20px">:</span></strong></td>
</tr>
 <tr>
  <td> </td>
  <td> </td>
 </tr>
 <tr>
  <td> </td>
  <td> </td>
 </tr>
</tbody>
</table>
<p dir="rtl"> </p>

这是我在ckeditor中添加的footer脚本:

<script src="https://cdn.ckeditor.com/4.11.2/full/ckeditor.js"></script>
<script>
var editor = CKEDITOR.replace('editor1', {
  height: 400,
  uiColor: '#E4E4E4',
  toolbarCanCollapse: true,
  language: 'ar',
  extraAllowedContent: 'span;ul;li;table;td;style;*[id];*(*);*{*}',
  allowedContent: true,
});
</script>

任何帮助!?

0 个答案:

没有答案