【问题标题】:remove strong tag for empty spaces in ckeditor删除ckeditor中空格的强标签
【发布时间】:2017-03-30 13:28:58
【问题描述】:

如何删除在单击粗体并为我的文本提供空格后创建的空格的强标记 例如 : 如果我给了 10 个空格,那么它将作为带有强标签的 nbsp 空间

`like_so_                          ` .

我想为我的空间消除那种强烈的标签

<html>((<strong>  `like_so_&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;`  </strong>)) </html>

【问题讨论】:

    标签: php html ckeditor


    【解决方案1】:

    使用正则表达式

    $output = preg_replace('~<strong>((&nbsp;|\s)*)</strong>~', '$1', $input);
    

    它将删除包含任意数量的仅包含 &amp;nbsp; 或白色字符的强标签

    【讨论】:

      猜你喜欢
      • 2012-07-31
      • 2016-11-27
      • 1970-01-01
      • 1970-01-01
      • 2011-04-08
      • 1970-01-01
      • 2016-07-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多