Skip to content

Commit b933db8

Browse files
author
Dustin Silk
committed
Any script tags added to index template get moved to the bottom of the outputted file.
1 parent 7180fe5 commit b933db8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tasks/patternprimer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ module.exports = function(grunt) {
7676
// generates the html output for the patterns
7777
var outputPatterns = function (patterns, cb) {
7878
getSourceFile(function generatePatterns(content) {
79+
var scripts = content.match(/<script[\s\S]*?>[\s\S]*?<\/script>/g);
80+
content = content.replace(/<script[\s\S]*?>[\s\S]*?<\/script>/g, "");
7981
patterns.forEach(function (file) {
8082
content += '<hr/>';
8183
content += '<div class="pattern"><div class="display">';
@@ -85,6 +87,7 @@ module.exports = function(grunt) {
8587
content += '</textarea>';
8688
content += '</div></div>';
8789
});
90+
content += scripts;
8891
content += '</body></html>';
8992
cb(content);
9093
});

0 commit comments

Comments
 (0)