HTML Tidy strip tags

2019-06-11 15:31发布

问题:

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>