TinyMCE和从Microsoft Word导入/复制粘贴 [英] TinyMCE and importing / copy paste from Microsoft Word

查看:2058
本文介绍了TinyMCE和从Microsoft Word导入/复制粘贴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难在TinyMCE是否支持从Microsoft word粘贴这个问题上得到准确的答案。我猜可能有很多关于这个主题的网上过时的信息,因为我已经看到如下答案:您可以安装一个插件来使其运行

  • 您必须使用单独的粘贴字按钮,而不是在编辑器中粘贴

  • >
  • 它根本不起作用(不管你做什么)

  • 我已经测试过这个,它看起来并不像是在开箱即用(答案#3),但我不确定这是由于我身边的配置/初始化问题还是存在一些其他外部的东西需要的。



    任何帮助将不胜感激。

    解决方案

    <它确实有效(也可以)。不过,您需要使用从Word粘贴按钮,因此TinyMCE可以过滤Word添加到其内容的任何外部标记。您还必须确保已加载粘贴插件(这是默认安装的一部分)。



    <但我相信你需要明确地在主题中添加按钮。 查看TinyMCE wiki上的这个例子

     插件:粘贴,
    theme_advanced_buttons3_add:pastetext,pasteword,selectall,

    会将插件和按钮添加到您想要的行中。 TinyMCE wiki声明粘贴默认情况下会执行Word过滤,但我从来没有看到它在野外工作,没有明确使用从Word粘贴按钮。

    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:

    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)

    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.

    Any help would be appreciated.

    解决方案

    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 paste plugin (which is part of the the default install) is loaded.

    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.

    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和从Microsoft Word导入/复制粘贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆