CKEditor 文本字体大小在从 outlook 复制文本时发生变化 [仅限 IE 11]

CKEditor Text fonts size gets changed on Copy of text from outlook [IE 11 ONLY]

我有一个奇怪的问题,在将文本从 outlook(桌面)复制到 CKEditor 时,文本的字体发生了变化。

所有字体都比源中的字体大。

此问题仅在 IE 11 中发生,在 Chrome 中它可以很好地保留字体。 我已经尝试了几个事件来捕获文本并进行一些格式化,但这搞砸了 Chrome.

中的字体

任何 solution/suggestion 欢迎。

来自 MS Office 的内容通常由 Paste From Word plugin. By design this plugin should work for Word only (more info here) 额外过滤,但有时当浏览器具有更好的剪贴板 API 支持时,它可能适用于其他 MS Office 产品(如 Outlook)。我怀疑在这种情况下 Chrome 中的数据是使用提到的插件过滤的,而未在 IE11 中过滤。这可能是两种情况下编辑器中的内容不同的原因。

要在插入到编辑器的内容之前捕获粘贴数据并对其进行修改,您应该使用 paste event. Example how to use it you can find below or under link: https://codepen.io/msamsel/pen/mqJPde?editors=1011

您可以根据需要修改插入的数据。实际上从 Word 粘贴是一个大过滤器,它检测从 MS Word 粘贴的数据并应用过滤器或修改多余的东西。

var editor = CKEDITOR.replace( 'editor' );

editor.on( 'paste', function( evt ) {
  console.log( evt.data.dataValue ); // There is no additional paragraph yet.
  evt.data.dataValue = '<p>Additional Paragraph</p>' + evt.data.dataValue; // Modify data pasted to editor.
} )