【问题标题】:Remove Paragraph Tags删除段落标签
【发布时间】:2013-02-22 11:09:46
【问题描述】:

在我的代码中,我想打印 Ck Editor 的值,但它显示了 ptag 文本 ptag 之类的标签,我怎样才能删除我的视图文件中的 ptags

echo "<td style='text-align:$sAlignment'>".$this->Html->link($arr_data['answer'], array('plugin' => 'user','controller' => 'user', 'action' => 'action',"id"=>$arr_data["id"],"slug"=>$arr_data['slug'],'admin' => true), array('class' => 'pass-reset-link'), null, null, false)."&nbsp;</td>";

【问题讨论】:

  • 只是 &lt;p&gt;元素,还是所有HTML?
  • 我不想在文本的开头和结尾只有

    元素

标签: html cakephp cakephp-1.3 cakephp-2.0


【解决方案1】:

我终于明白了,这就是解决方案......

echo "<td style='text-align:$sAlignment'>".$this->Html->link(strip_tags($arr_data['answer']), array('plugin' => 'user','controller' => 'user', 'action' => 'action',"id"=>$arr_data["id"],"slug"=>$arr_data['slug'],'admin' => true), array('class' => 'pass-reset-link'), null, null, false)."&nbsp;</td>";

【讨论】:

    【解决方案2】:

    将以下行添加到 ckeditor.js 配置文件中:

    n.setRules('p',{indent:false,breakAfterOpen:false});

    欲了解更多信息,请访问以下链接:

    http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Output_Formatting

    http://docs.cksource.com/CKEditor_3.x/Howto/Removing_Files

    【讨论】:

      猜你喜欢
      • 2014-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多