【发布时间】:2010-08-09 16:07:19
【问题描述】:
我们运行一些大型目录,用户经常将 Word 文档等内容复制/粘贴到我们的 TinyMCE html 编辑器中。
这样的问题通常是例如以下文本被隐藏在我们的网页上:
<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; mso-layout-grid-align:none; punctuation-wrap:simple; text-autospace:none; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->
是否有 TinyMCE 插件或其他一些跨浏览器 html 编辑器可以自动删除它?
或者另一种解决方案是一些 php 正则表达式命令或可以去除这些注释声明的东西。
【问题讨论】:
-
祝你好运。我看了又看,没有找到任何东西,但我像鹰一样看这篇文章,希望有人有比手动使用 Dreamweaver 清理 Word 的烂摊子更好的解决方案。
-
在ckeditor.com尝试ckeditor
-
TinyMCE 似乎具有“从 Word 粘贴”功能,就像其他 WYSIWYG 编辑器一样。查看副本。
-
添加到 Pekka 的评论中,我还看到 TinyMCE 将 Paste from word 设置为在 Drupal 中使用时的默认粘贴行为。似乎这是 Drupal 公开的 TinyMCE 功能,而不是 Drupal 的额外功能。
标签: php javascript tinymce