grunt-processhtml
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -18,2 +18,3 @@ var fs = require('fs'); | ||
var re = new RegExp('(\\s*(?:' + block.attr + ')=[\'"])(.*)?(".*)', 'gi'); | ||
var replaced = false; | ||
@@ -26,5 +27,12 @@ // Only run attr replacer for the block content | ||
replaced = true; | ||
return start + asset + end; | ||
}); | ||
// If the attribute doesn't exist, add it. | ||
if (!replaced) { | ||
replacedBlock = blockContent.replace(/>/, ' ' + block.attr + '="' + block.asset + '">'); | ||
} | ||
return content.replace(blockLine, replacedBlock); | ||
@@ -31,0 +39,0 @@ }, |
{ | ||
"name": "grunt-processhtml", | ||
"description": "Process html files at build time to modify them depending on the release environment", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"homepage": "https://github.com/dciccale/grunt-processhtml", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -497,2 +497,4 @@ # grunt-processhtml [![Build Status](https://travis-ci.org/dciccale/grunt-processhtml.png?branch=master)](https://travis-ci.org/dciccale/grunt-processhtml) [![NPM version](https://badge.fury.io/js/grunt-processhtml.png)](http://badge.fury.io/js/grunt-processhtml) | ||
## Release History | ||
- 0.3.2 Fix/feature #39 | ||
- 0.3.1 Fix #35 | ||
- 0.3.0 Allow creating custom block types. | ||
@@ -499,0 +501,0 @@ - 0.2.9 Added `recursive` option |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24947
259
511