Skip to content

Commit

Permalink
Any script tags added to index template get moved to the bottom of th…
Browse files Browse the repository at this point in the history
…e outputted file.
  • Loading branch information
Dustin Silk committed Oct 16, 2014
1 parent 7180fe5 commit b933db8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/patternprimer.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ module.exports = function(grunt) {
// generates the html output for the patterns
var outputPatterns = function (patterns, cb) {
getSourceFile(function generatePatterns(content) {
var scripts = content.match(/<script[\s\S]*?>[\s\S]*?<\/script>/g);
content = content.replace(/<script[\s\S]*?>[\s\S]*?<\/script>/g, "");
patterns.forEach(function (file) {
content += '<hr/>';
content += '<div class="pattern"><div class="display">';
Expand All @@ -85,6 +87,7 @@ module.exports = function(grunt) {
content += '</textarea>';
content += '</div></div>';
});
content += scripts;
content += '</body></html>';
cb(content);
});
Expand Down

0 comments on commit b933db8

Please sign in to comment.