Html TinyMCE 和从 Microsoft Word 导入/复制粘贴

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1255738/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 00:31:58  来源:igfitidea点击:

TinyMCE and importing / copy paste from Microsoft Word

htmlms-wordtinymce

提问by leora

I am struggling to get an accurate answer on this questions on whether TinyMCE supports pasting from Microsoft word. I guess there may be a lot of out of date information on the web on this topic as I have seen answers such as:

我正在努力获得有关 TinyMCE 是否支持从 Microsoft Word 粘贴的问题的准确答案。我想网上可能有很多关于这个主题的过时信息,因为我看到了以下答案:

  1. There is a plugin you can install to get it to work
  2. You have to use a separate "paste from word" button as opposed to pasting in the editor
  3. it should work fine out of the box
  4. it doesn't work at all (no matter what you do)
  1. 您可以安装一个插件以使其正常工作
  2. 您必须使用单独的“从单词粘贴”按钮,而不是在编辑器中粘贴
  3. 它应该开箱即用
  4. 它根本不起作用(无论你做什么)

I have tested this and it doesn't seem like it works out of the box (answer #3) but I am not sure if this is due to a configuration / initialization issue on my side or there is some other external thing needed.

我已经对此进行了测试,但它似乎不是开箱即用的(答案#3),但我不确定这是由于我这边的配置/初始化问题还是需要其他一些外部事物。

Any help would be appreciated.

任何帮助,将不胜感激。

回答by ajm

It does indeed work (as well as it can). You will need to use the "paste from Word" button, though, so TinyMCE can filter any of the extraneous markup that Word adds to its content. You'll also have to make sure the pasteplugin (which is part of the the default install) is loaded.

它确实有效(尽其所能)。不过,您将需要使用“从 Word 粘贴”按钮,这样 TinyMCE 可以过滤 Word 添加到其内容中的任何无关标记。您还必须确保paste插件(这是默认安装的一部分)已加载。

I believe that you'll need to explicitly add the button in your theme, though. Take a look at this example from the TinyMCE wiki.

不过,我相信您需要在主题中明确添加按钮。从 TinyMCE wiki 中查看此示例

plugins : "paste",
theme_advanced_buttons3_add : "pastetext,pasteword,selectall",

will add the plugin and button (to whichever row you'd like). The TinyMCE wiki claims paste does Word filtering by default, but I've never seen it work in the wild without explicitly using the "paste from Word" button.

将添加插件和按钮(到您想要的任何行)。TinyMCE wiki 声称 paste 默认情况下会进行 Word 过滤,但我从未见过它在没有明确使用“从 Word 粘贴”按钮的情况下在野外工作。

回答by ppant

For me it works without "paste from word" button by directly pasting the content from word. I am using 3.3.9.3

对我来说,它无需“从单词粘贴”按钮直接从单词粘贴内容即可工作。我正在使用 3.3.9.3