Skip to content

Commit

Permalink
change default behaviour to keep default values of form elements (#1249)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper De Moor authored and devongovett committed Apr 29, 2018
1 parent 8cfe0e2 commit f75cc44
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/parcel-bundler/src/transforms/htmlnano.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = async function(asset) {
const htmlNanoConfig = asset.package.htmlnano ||
(await asset.getConfig(['.htmlnanorc', '.htmlnanorc.js'])) || {
collapseWhitespace: 'conservative',
removeRedundantAttributes: false,
minifyCss: {
safe: true
}
Expand Down
10 changes: 10 additions & 0 deletions packages/core/parcel-bundler/test/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ describe('html', function() {
);
});

it('should not minify default values inside HTML in production mode', async function() {
await bundle(__dirname + '/integration/htmlnano-defaults-form/index.html', {
production: true
});

let html = fs.readFileSync(__dirname + '/dist/index.html', 'utf8');
assert(html.includes('<input type="text">'));
assert(!html.includes('\n'));
});

it('should not prepend the public path to assets with remote URLs', async function() {
await bundle(__dirname + '/integration/html/index.html');

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<html>
<head>
<title>Test</title>
</head>
<body>
<form>
<input type="text">
</form>
</body>
</html>

0 comments on commit f75cc44

Please sign in to comment.