<tfoot id='2kpmQ'></tfoot>

    <legend id='2kpmQ'><style id='2kpmQ'><dir id='2kpmQ'><q id='2kpmQ'></q></dir></style></legend>

    <small id='2kpmQ'></small><noframes id='2kpmQ'>

      <bdo id='2kpmQ'></bdo><ul id='2kpmQ'></ul>
  1. <i id='2kpmQ'><tr id='2kpmQ'><dt id='2kpmQ'><q id='2kpmQ'><span id='2kpmQ'><b id='2kpmQ'><form id='2kpmQ'><ins id='2kpmQ'></ins><ul id='2kpmQ'></ul><sub id='2kpmQ'></sub></form><legend id='2kpmQ'></legend><bdo id='2kpmQ'><pre id='2kpmQ'><center id='2kpmQ'></center></pre></bdo></b><th id='2kpmQ'></th></span></q></dt></tr></i><div id='2kpmQ'><tfoot id='2kpmQ'></tfoot><dl id='2kpmQ'><fieldset id='2kpmQ'></fieldset></dl></div>

    1. PHP 清理粘贴的 Microsoft 输入

      时间:2023-07-16
      <legend id='qffom'><style id='qffom'><dir id='qffom'><q id='qffom'></q></dir></style></legend>
          <tbody id='qffom'></tbody>

        <small id='qffom'></small><noframes id='qffom'>

        <i id='qffom'><tr id='qffom'><dt id='qffom'><q id='qffom'><span id='qffom'><b id='qffom'><form id='qffom'><ins id='qffom'></ins><ul id='qffom'></ul><sub id='qffom'></sub></form><legend id='qffom'></legend><bdo id='qffom'><pre id='qffom'><center id='qffom'></center></pre></bdo></b><th id='qffom'></th></span></q></dt></tr></i><div id='qffom'><tfoot id='qffom'></tfoot><dl id='qffom'><fieldset id='qffom'></fieldset></dl></div>

            <tfoot id='qffom'></tfoot>
              <bdo id='qffom'></bdo><ul id='qffom'></ul>
                本文介绍了PHP 清理粘贴的 Microsoft 输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个网站,用户可以在其中使用 TinyMCE 的自定义实现发布内容(如在论坛、评论等中).他们中的很多人喜欢复制&从 Word 粘贴,这意味着他们的输入通常带有大量相关的 MS 内联格式.

                I have a site where users can post stuff (as in forums, comments, etc) using a customised implementation of TinyMCE. A lot of them like to copy & paste from Word, which means their input often comes with a plethora of associated MS inline formatting.

                我不能只是摆脱 因为 TinyMCE 依赖于 span 标签来进行一些格式化,我不能(也不想)强制说用户使用 TinyMCE 的从 Word 粘贴"功能(无论如何似乎效果不佳).

                I can't just get rid of <span whatever> as TinyMCE relies on the span tag for some of it's formatting, and I can't (and don't want to) force said users to use TinyMCE's "Paste From Word" feature (which doesn't seem to work that well anyway).

                有谁知道可以为我处理这个问题的库/类/函数?这一定是一个普遍的问题,虽然我找不到任何明确的东西.我最近一直在想,一系列寻找 MS 特定模式的蛮力正则表达式可能会奏效,但我不想重写可能已经可用的东西,除非我必须这样做.

                Anyone know of a library/class/function that would take care of this for me? It must be a common problem, though I can't find anything definitive. I've been thinking recently that a series of brute-force regexes looking for MS-specific patterns might do the trick, but I don't want to re-write something that may already be available unless I must.

                此外,修复卷曲引号、破折号等也不错.我现在有自己的东西要做,但我真的很想找到一个 MS 转换过滤器来统治所有这些.

                Also, fixing of curly quotes, em-dashes, etc would be good. I have my own stuff to do this now, but I'd really just like to find one MS-conversion filter to rule them all.

                推荐答案

                HTML Purifier 将创建符合标准的标记和过滤器排除许多可能的攻击(例如 XSS).

                HTML Purifier will create standards compliant markup and filter out many possible attacks (such as XSS).

                为了不需要 XSS 过滤的更快清理,我使用 PECL 扩展 Tidy 这是一个Tidy HTML 实用程序的绑定.

                For faster cleanups that don't require XSS filtering, I use the PECL extension Tidy which is a binding for the Tidy HTML utility.

                如果这些对您没有帮助,我建议您切换到具有此功能的 FCKEditor 内置.

                If those don't help you, I suggest you switch to FCKEditor which has this feature built-in.

                这篇关于PHP 清理粘贴的 Microsoft 输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在 php 中将 .doc 转换为 html 下一篇:如何使用 PHP 或 HTML 在浏览器中查看/打开 Word 文档

                相关文章

              • <i id='HAvnu'><tr id='HAvnu'><dt id='HAvnu'><q id='HAvnu'><span id='HAvnu'><b id='HAvnu'><form id='HAvnu'><ins id='HAvnu'></ins><ul id='HAvnu'></ul><sub id='HAvnu'></sub></form><legend id='HAvnu'></legend><bdo id='HAvnu'><pre id='HAvnu'><center id='HAvnu'></center></pre></bdo></b><th id='HAvnu'></th></span></q></dt></tr></i><div id='HAvnu'><tfoot id='HAvnu'></tfoot><dl id='HAvnu'><fieldset id='HAvnu'></fieldset></dl></div>

              • <tfoot id='HAvnu'></tfoot>
                • <bdo id='HAvnu'></bdo><ul id='HAvnu'></ul>

                <small id='HAvnu'></small><noframes id='HAvnu'>

              • <legend id='HAvnu'><style id='HAvnu'><dir id='HAvnu'><q id='HAvnu'></q></dir></style></legend>