Skip to content

Commit 9f8eaf6

Browse files
committed
feat: clean html at rendering
1 parent 3739152 commit 9f8eaf6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

core/lib/object_factory.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
var patternEngines = require('./pattern_engines');
44
var path = require('path');
55
var extend = require('util')._extend;
6+
var cleanHtml = require('js-beautify').html;
67

78
// Pattern properties
89

@@ -73,7 +74,7 @@ Pattern.prototype = {
7374
// render function
7475
render: function (data, partials) {
7576
if (this.engine) {
76-
return this.engine.renderPattern(this, data || this.jsonFileData, partials);
77+
return cleanHtml(this.engine.renderPattern(this, data || this.jsonFileData, partials));
7778
}
7879
return null;
7980
},

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"diveSync": "^0.3.0",
88
"fs-extra": "^0.30.0",
99
"glob": "^7.0.0",
10+
"js-beautify": "^1.6.3",
1011
"js-yaml": "^3.6.1",
1112
"json5": "^0.5.0",
1213
"lodash": "~4.13.1",

0 commit comments

Comments
 (0)