Skip to content

Commit

Permalink
Docs: add notice for minifyConditionalComments
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Nov 9, 2020
1 parent bb6f4d4 commit 4b01af2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,26 @@ Minified:
<!--[if lte IE 7]><style>.title {color:red}</style><![endif]-->
```

##### Notice

Due to [the limitation of PostHTML](https://github.com/posthtml/posthtml-parser/issues/9) (which is actually a issue from upstream [htmlparser2](https://github.com/fb55/htmlparser2/pull/146)), following html snippet is not supported:

```html
<!--[if lt IE 7]><html class="no-js ie6"><![endif]-->
<!--[if IE 7]><html class="no-js ie7"><![endif]-->
<!--[if IE 8]><html class="no-js ie8"><![endif]-->
<!--[if gt IE 8]><!--><html class="no-js"><!--<![endif]-->
```

Which will result in:

```html
<!--[if lt IE 7]><html class="no-js ie6"></html><![endif]-->
<!--[if IE 7]><html class="no-js ie7"></html><![endif]-->
<!--[if IE 8]><html class="no-js ie8"></html><![endif]-->
<!--[if gt IE 8]><!--><html class="no-js"></html><!--<![endif]-->
```

### removeRedundantAttributes
Removes redundant attributes from tags if they contain default values:
- `method="get"` from `<form>`
Expand Down

0 comments on commit 4b01af2

Please sign in to comment.