<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 输入

      PHP to clean-up pasted Microsoft input(PHP 清理粘贴的 Microsoft 输入)
      <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 输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <tbody id='HAvnu'></tbody>
                • <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>