在 WYSIWYG 编辑器中粘贴 Microsoft Excel 数据时删除不需要的标签的方法
当您从 Microsoft Excel 复制数据然后粘贴到所见即所得时,它包含许多不常见的属性。 而我们现有的所见即所得没有任何功能来删除 Excel 数据的那些不必要的属性。我知道有很多所见即所得编辑器支持此功能。
但如何在我们现有的所见即所得编辑器中轻松实现该功能呢?
太感谢了。
While you copy data from Microsoft Excel and then paste into WYSIWYG, it contains lot of non-common attributes.
And our existing WYSIWYG does not have any feature to remove those unnecessary attributes of that excel data. I know there are many WYSIWYG Editors which support this feature.
But how can I implement that feature in our existing WYSIWYG editor in an easy step?
Thank you so much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的步骤是使用现有的所见即所得编辑器,例如 TinyMCE 或 CKEditor。如果做不到这一点,我会查看其中任何一个的源代码,看看它们粘贴的 HTML 清理功能是如何工作的。两者都采用了一种技巧,将粘贴重定向到屏幕外的元素,然后在将粘贴的内容插入编辑器的主编辑窗格之前对其进行清理。
The easiest step of all would be to use an existing WYSIWYG editor, such as TinyMCE or CKEditor. Failing that, I'd look at the source code of either of those to see how their pasted HTML cleaning functionality works. Both employ a trick to redirect a paste into an off-screen element where the pasted content is then cleaned before being inserted into the editor's main edit pane.