posthtml / posthtml-beautify

A posthtml plugin to beautify you html files. Online service -

Home Page:https://posthtml.github.io/posthtml-beautify/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

resolve parses Downlevel-revealed and valid version

Scrum opened this issue · comments

  • Downlevel-revealed Conditional Comments
<![if !IE]><p>You are not using Internet Explorer.</p><![endif]>

after htmlparser2 return

{ tag: 'p',
  content: [ 'You are not using Internet Explorer.' ] }
  • Valid Downlevel-revealed Conditional Comments
<!--[if !IE]>--><link href="non-ie.css" rel="stylesheet"><!--<![endif]-->
<!--[if gte IE 7]><!--><p>This is shown in downlevel browsers and IE7 or later.</p><!--<![endif]-->

after htmlparser2 return

1: '<!--[if !IE]>-->',
2: { tag: 'link',
     attrs: { href: 'non-ie.css', rel: 'stylesheet' } },
3: '<!--<![endif]-->'
4: '<!--[if gt IE 6]><!-->'
5: 'This code displays on non-IE browsers and on IE 7 or higher.'
6: '<!--<![endif]-->'

Create preparse or convert to normal comment.