Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing #586

  • Loading branch information...
commit a88b0febabeff1acefc023ec1c3ead8be708a0c5 1 parent 45c9d02
@sleeper authored
Showing with 11 additions and 1 deletion.
  1. +1 −1  cli/tasks/usemin.js
  2. +10 −0 cli/test/test-usemin.js
View
2  cli/tasks/usemin.js
@@ -308,7 +308,7 @@ module.exports = function(grunt) {
grunt.registerHelper('usemin:css', function(content, block, target) {
var indent = (block.split(linefeed)[0].match(/^\s*/) || [])[0];
- return content.replace(block, indent + '<link rel="stylesheet" href="' + target + '"\/?>');
+ return content.replace(block, indent + '<link rel="stylesheet" href="' + target + '"\/>');
});
grunt.registerHelper('usemin:js', function(content, block, target) {
View
10 cli/test/test-usemin.js
@@ -37,5 +37,15 @@ describe('usemin', function() {
assert.ok( changed.match(/img[^\>]+src=['"]images\/misc\/2a436\.test\.png["']/) );
});
});
+ describe('usemin:css', function() {
+ it("should replace a block with link on furnished target", function() {
+ grunt.log.muted = true;
+ var block = " foo\nbar\nbaz";
+ var content = "before block\n" + block + "\nafter block";
+ var awaited = "before block\n <link rel=\"stylesheet\" href=\"foo\"/>\nafter block";
+ var changed = grunt.helper('usemin:css', content, block, 'foo');
+ assert.ok( changed == awaited );
+ });
+ });
});
Please sign in to comment.
Something went wrong with that request. Please try again.