gulp-htmlmin处理空格简直奇葩

This commit is contained in:
结发受长生 2019-06-14 09:56:59 +08:00
parent 4f5f3c2b2d
commit 44e79f3b55
2 changed files with 5 additions and 3 deletions

View File

@ -34,7 +34,7 @@ gulp.task('compressHtml', () => {
}
const minOption = {
collapseWhitespace: true, //删除html中的空白
conservativeCollapse: true, //将多个空白折叠为1空白(永远不要完全移除), 必须与 collapseWhitespace=true 一起使用
conservativeCollapse: false, //将多个空白折叠为1空白(永远不要完全移除), 必须与 collapseWhitespace=true 一起使用
collapseBooleanAttributes: true, //省略布尔属性的值 <input checked="true"/> ==> <input />
removeEmptyAttributes: true, //删除所有空属性值 <input id="" /> ==> <input />
removeScriptTypeAttributes: true, //删除<script>的type="text/javascript"

View File

@ -3,14 +3,16 @@
<% if (post.prev){ %>
<a href="<%- url_for(post.prev.path) %>" id="article-nav-newer" class="article-nav-link-wrap">
<div class="article-nav-title">
<i class="icon icon-arrow-circle-o-left"></i>&nbsp;<%= post.prev.title %>
<i class="icon icon-arrow-circle-o-left"></i>
<%= post.prev.title %>
</div>
</a>
<% } %>
<% if (post.next){ %>
<a href="<%- url_for(post.next.path) %>" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">
<%= post.next.title %>&nbsp;<i class="icon icon-arrow-circle-o-right"></i>
<%= post.next.title %>&nbsp;
<i class="icon icon-arrow-circle-o-right"></i>
</div>
</a>
<% } %>