Skip to content

Commit f72cb45

Browse files
committed
Add .htm to extensions for html file type
1 parent eb3f638 commit f72cb45

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/resource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Resource.prototype.getType = function getType () {
5959
var hasHtmlData = !!this.htmlData;
6060

6161
switch (true) {
62-
case ext == '.html':
62+
case ext == '.html' || ext == '.htm':
6363
return types.html;
6464
case ext == '.css':
6565
case !ext && parentType == types.css:

test/unit/resource-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ describe('Resource', function() {
77
describe('#Resource', function() {
88
it('should return correct type based on extension', function() {
99
var html = new Resource('http://example.com', 'index.html');
10+
var htm = new Resource('http://example.com', 'index.htm');
1011
var css = new Resource('http://example.com/style.css', 'style.css');
1112
var img = new Resource('http://example.com/img/logo.png', 'logo.png');
1213

1314
html.getType().should.be.eql(types.html);
15+
htm.getType().should.be.eql(types.html);
1416
css.getType().should.be.eql(types.css);
1517
img.getType().should.be.eql(types.other);
1618
});

0 commit comments

Comments
 (0)