Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Commit 271bf0e

Browse files
committed
fix boolean attribute collapsing for v-bind shorthand (fix #73)
1 parent 7a74e51 commit 271bf0e

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

lib/compiler.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@ if (process.env.NODE_ENV === 'production') {
1818
var htmlMinifier = require('html-minifier')
1919
// required for Vue 1.0 shorthand syntax
2020
var htmlMinifyOptions = {
21-
customAttrSurround: [[/@/, new RegExp('')], [/:/, new RegExp('')]],
2221
collapseWhitespace: true,
2322
removeComments: true,
2423
collapseBooleanAttributes: true,
2524
removeAttributeQuotes: true,
26-
// this is disabled by default to avoid removing
27-
// "type" on <input type="text">
28-
removeRedundantAttributes: false,
2925
useShortDoctype: true,
3026
removeEmptyAttributes: true,
3127
removeOptionalTags: true

test/expects/basic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ exports.default = {
3737
}
3838
};
3939
if (module.exports.__esModule) module.exports = module.exports.default
40-
;(typeof module.exports === "function"? module.exports.options: module.exports).template = "<h1 :id=id @click=hi>hello</h1><input type=text>"
40+
;(typeof module.exports === "function"? module.exports.options: module.exports).template = "<h1 :id=id @click=hi>hello</h1><input type=text> <button :disabled=loading>hihi</button>"

test/fixtures/basic.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<template>
88
<h1 :id="id" @click="hi">hello</h1>
99
<input type="text">
10+
<button :disabled="loading">hihi</button>
1011
</template>
1112

1213
<script>

0 commit comments

Comments
 (0)