From 7614dea24dcc600a60356723473bef026fcfce0b Mon Sep 17 00:00:00 2001 From: Bas van Wetten Date: Sat, 27 Apr 2019 11:22:17 +0200 Subject: [PATCH] Allow html prettyPrint options Package uses 'commonjs-html-prettyprinter'. Allow for options to be passed to html.prettyPrint function. --- gulp-html-partial.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gulp-html-partial.js b/gulp-html-partial.js index 6bc3e04..44d3fc4 100644 --- a/gulp-html-partial.js +++ b/gulp-html-partial.js @@ -19,7 +19,8 @@ module.exports = (function () { const options = { tagName: 'partial', basePath: '', - variablePrefix: '@@' + variablePrefix: '@@', + prettyPrintOptions: { } }; /** @@ -126,9 +127,9 @@ module.exports = (function () { */ function injectHTML(file) { if (file.contents) { - file.contents = new Buffer(html.prettyPrint(getHTML(file.contents.toString()))); + file.contents = new Buffer(html.prettyPrint(getHTML(file.contents.toString()), options.prettyPrintOptions)); } else { - file = new Buffer(html.prettyPrint(getHTML(file.toString()))) + file = new Buffer(html.prettyPrint(getHTML(file.toString()), options.prettyPrintOptions)) } return file;