Skip to content

Commit 6a298b4

Browse files
authored
Use filename as a unique identifier
Otherwise subsequent calls will always only return the template, that was loaded first. This is because Marco is using cached Templates by default.
1 parent 6462447 commit 6a298b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/consolidate.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,9 +1467,10 @@ exports.marko.render = function(str, options, fn) {
14671467
return promisify(fn, function (fn) {
14681468
var engine = requires.marko || (requires.marko = require('marko'));
14691469
options.writeToDisk = !!options.cache;
1470+
options.filename = options.filename || 'string.marko';
14701471

14711472
try {
1472-
var tmpl = cache(options) || cache(options, engine.load('string.marko', str, options));
1473+
var tmpl = cache(options) || cache(options, engine.load(options.filename, str, options));
14731474
tmpl.renderToString(options, fn)
14741475
} catch (err) {
14751476
fn(err);

0 commit comments

Comments
 (0)