Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding trailing '/' to css links #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ Block.prototype.build = function () {
if (ext === 'js') {
return util.format('%s<script src="%s"></script>', this.indent, replacement);
} else if (ext === 'css') {
return util.format('%s<link rel="stylesheet" href="%s">', this.indent, replacement);
return util.format('%s<link rel="stylesheet" href="%s"/>', this.indent, replacement);
}
return this.indent + replacement;
}.bind(this));
};

Block.prototype.compile = function (tasks) {
var task = tasks[this.taskName];

if (task) {
this.replacements = task.src;
this.template = task.tpl;
Expand Down
2 changes: 1 addition & 1 deletion test/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Buffer mode', function () {

it('should work with inline html', function (done) {
var fixture = '<!DOCTYPE html><head><!-- build:css --><link rel="stylesheet" href="_index.prefix.css"><!-- endbuild --></head>';
var expected = '<!DOCTYPE html><head><link rel="stylesheet" href="css/combined.css"></head>';
var expected = '<!DOCTYPE html><head><link rel="stylesheet" href="css/combined.css"/></head>';

var stream = plugin({css: 'css/combined.css'});
compare(new Buffer(fixture), expected, stream, done);
Expand Down
2 changes: 1 addition & 1 deletion test/expected.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<title>Test file</title>

<link rel="stylesheet" href="css/combined.css">
<link rel="stylesheet" href="css/combined.css"/>
</head>
<body>
<script src="js/one.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('Stream mode', function () {

it('should work with inline html', function (done) {
var fixture = '<!DOCTYPE html><head><!-- build:css --><link rel="stylesheet" href="_index.prefix.css"><!-- endbuild --></head>';
var expected = '<!DOCTYPE html><head><link rel="stylesheet" href="css/combined.css"></head>';
var expected = '<!DOCTYPE html><head><link rel="stylesheet" href="css/combined.css"/></head>';

var stream = plugin({css: 'css/combined.css'});
compare(stringToStream(fixture), expected, stream, done);
Expand Down