@@ -17,7 +17,8 @@ var patternlab_engine = function(){
17
17
pa = require ( './pattern_assembler' ) ,
18
18
mh = require ( './media_hunter' ) ,
19
19
lh = require ( './lineage_hunter' ) ,
20
- pe = require ( './pattern_exporter' )
20
+ pe = require ( './pattern_exporter' ) ,
21
+ he = require ( 'html-entities' ) . AllHtmlEntities ,
21
22
patternlab = { } ;
22
23
23
24
patternlab . package = fs . readJSONSync ( './package.json' ) ;
@@ -143,6 +144,8 @@ var patternlab_engine = function(){
143
144
patternlab . patterns . push ( currentPattern ) ;
144
145
} ) ;
145
146
147
+ var entity_encoder = new he ( ) ;
148
+
146
149
//render all patterns last, so lineageR works
147
150
patternlab . patterns . forEach ( function ( pattern , index , patterns ) {
148
151
@@ -152,6 +155,14 @@ var patternlab_engine = function(){
152
155
//write the compiled template to the public patterns directory
153
156
fs . outputFileSync ( './public/patterns/' + pattern . patternLink , patternlab . header + pattern . patternPartial + patternFooter ) ;
154
157
158
+ //write the mustache file too
159
+ fs . outputFileSync ( './public/patterns/' + pattern . patternLink . replace ( '.html' , '.mustache' ) , entity_encoder . encode ( pattern . template ) ) ;
160
+
161
+ //write the encoded version too
162
+ fs . outputFileSync ( './public/patterns/' + pattern . patternLink . replace ( '.html' , '.escaped.html' ) , entity_encoder . encode ( pattern . patternPartial ) ) ;
163
+
164
+
165
+
155
166
} ) ;
156
167
157
168
//export patterns if necessary
0 commit comments