Comparing version 0.5.14 to 0.5.15
@@ -18,3 +18,8 @@ var _ = require("underscore"); | ||
_.each(config.plugins.parsers, function(value, key){ | ||
self.parsers[key] = module_utils.requireAndSetup(value, config); | ||
var parser = module_utils.requireAndSetup(value, config); | ||
var extensions = _.union( [key], (parser.supportedExtensions || []) ); | ||
_.each(extensions, function(extension) { | ||
self.parsers[extension] = parser; | ||
}); | ||
}); | ||
@@ -21,0 +26,0 @@ }, |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "0.5.14", | ||
"version": "0.5.15", | ||
"homepage": "https://github.com/laktek/punch", | ||
@@ -18,0 +18,0 @@ "author": "Lakshan Perera <lakshan@web2media.net> (http://laktek.com)", |
@@ -36,8 +36,11 @@ var default_handler = require("../lib/content_handler.js"); | ||
spyOn(module_utils, "requireAndSetup").andCallFake(function(id, config){ | ||
return {"id": id}; | ||
if (id === "sample_markdown_parser") { | ||
return { "id": id, "supportedExtensions": [".markdown", ".md"] }; | ||
} else { | ||
return {"id": id}; | ||
} | ||
}); | ||
default_handler.setup(sample_config); | ||
expect(default_handler.parsers).toEqual({".markdown": {"id": "sample_markdown_parser"}, ".yml": {"id": "sample_yml_parser"}}); | ||
expect(default_handler.parsers).toEqual({".markdown": {"id": "sample_markdown_parser", "supportedExtensions": [".markdown", ".md"] }, ".md": {"id": "sample_markdown_parser", "supportedExtensions": [".markdown", ".md"] }, ".yml": {"id": "sample_yml_parser"}}); | ||
}); | ||
@@ -44,0 +47,0 @@ |
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
1009882
8193
161