summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/handlebars/runtime.js2
-rw-r--r--spec/regressions.js8
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/handlebars/runtime.js b/lib/handlebars/runtime.js
index 6b31a7b..52d9b94 100644
--- a/lib/handlebars/runtime.js
+++ b/lib/handlebars/runtime.js
@@ -161,7 +161,7 @@ export function template(templateSpec, env) {
if (templateSpec.usePartial) {
container.partials = container.merge(options.partials, env.partials);
}
- if (templateSpec.useDecorators) {
+ if (templateSpec.usePartial || templateSpec.useDecorators) {
container.decorators = container.merge(options.decorators, env.decorators);
}
} else {
diff --git a/spec/regressions.js b/spec/regressions.js
index ae0797e..cca126e 100644
--- a/spec/regressions.js
+++ b/spec/regressions.js
@@ -212,4 +212,12 @@ describe('Regressions', function() {
};
shouldCompileToWithPartials(string, [{}, {}, partials], true, 'doctypelayoutsubcontent');
});
+ it('GH-1089: should support failover content in multiple levels of inline partials', function() {
+ var string = '{{#> layout}}{{/layout}}';
+ var partials = {
+ doctype: 'doctype{{> content}}',
+ layout: '{{#> doctype}}{{#*inline "content"}}layout{{#> subcontent}}subcontent{{/subcontent}}{{/inline}}{{/doctype}}'
+ };
+ shouldCompileToWithPartials(string, [{}, {}, partials], true, 'doctypelayoutsubcontent');
+ });
});