HTML Tidy strip tags

喜欢而已 提交于 2019-12-08 13:46:20

问题


I'm working on dynamic template for bootstrap, and i'm using HTML Tidy. However it seem HTML Tidy remove specific tags, for example:

      <b class="caret"></b>
    

How to supposed solve this ? my options/config is

     $options = array('indent'  => true,
                 'wrap'   => '300',
                "indent-spaces" => 4,
                'clean'=>false  );
    

Thanks..


回答1:


Also had this problem. You can add &nbsp; in the tags. Html tidy will remove the tags since it thinks nothing will be displayed in any case, for example:

<b class="caret">&nbsp;</b>




回答2:


I also had the same issues as both of you, the &nbsp; helped, i just wanted to mention that if you work responsible, that you also would have to put a &nbsp; into the collapse-icon in the navbar, see following:

            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>

should be:

            <span class="icon-bar">&nbsp;</span>
            <span class="icon-bar">&nbsp;</span>
            <span class="icon-bar">&nbsp;</span>


来源:https://stackoverflow.com/questions/12871339/html-tidy-strip-tags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!