【问题标题】:TinyMCE adds styles on saveTinyMCE 在保存时添加样式
【发布时间】:2011-01-23 19:44:31
【问题描述】:

你好: 我正在使用 tinyMCE,从 word 中复制并将文本放入编辑器中。当我保存它时,它应该可以正常工作并给我这种格式:

<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="line-height: 115%; color: #0f243e; font-size: 12pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-themecolor: text2; mso-themeshade: 128;"><span style="font-family: Calibri;">Course Description:</span></span></p>                                                         

但是当我转到同一页面并再次点击保存时,我得到了这个代码

<span style="line-height: 18px;">

<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; mso-outline-level: 2;"><strong><span style="font-size: 13.5pt; font-family: &quot;Cambria&quot;,&quot;serif&quot;; mso-fareast-font-family: &quot;Times New Roman&quot;; mso-bidi-font-family: Arial; color: #4f81bd;">Course Description:</span></strong><strong><span style="font-size: 18.0pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: &quot;Times New Roman&quot;; color: #7d7d7d;"></span></strong></p>

【问题讨论】:

  • 请准确描述您的工作以及您的 tinymce 配置是什么样的!

标签: javascript styles tinymce rte


【解决方案1】:

您会看到额外的格式,因为您是从 MS Word 粘贴的。使用 Word 中的清除格式选项或使用纯文本编辑器(例如记事本),在粘贴时不会添加任何额外的格式。

【讨论】:

    【解决方案2】:

    对我来说,我有同样的问题,我的添加帖子有

    $_POST = array_map( 'stripslashes', $_POST );
    

    我的编辑页面没有,我添加了它,它很好。所以比较您的添加和编辑页面,可能会有所不同。

    【讨论】:

    • 这怎么没用?我有完全相同的问题,并且通过添加这 1 行很容易解决?为什么要通过寻找问题来尝试并在您失去积分时提供帮助????放心,我不会再帮忙了。
    猜你喜欢
    • 2021-05-15
    • 1970-01-01
    • 2013-01-14
    • 1970-01-01
    • 1970-01-01
    • 2019-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多