Skip to content

Commit

Permalink
core: renderer: adds support for <% include view(data, param2,. ... ) %>
Browse files Browse the repository at this point in the history
  • Loading branch information
dresende committed Jul 31, 2024
1 parent c81e98e commit a3f8cb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ export class Renderer {
code += `\n${indent()}// include ${match.groups.method}\n`;
}

code += `${indent()}__output += ((self) => {\n`;
code += `${indent()}__output += (() => {\n`;
code += `${indent()}\tlet self = ${match.groups.parameters?.length ? match.groups.parameters : "{}"};\n`;
code += view.code;
code += `${indent()}})(${match.groups.parameters?.length ? match.groups.parameters : "{}"});\n\n`;
code += `${indent()}})();\n\n`;
} catch (err) {
code += `${indent()}__output += "${escape(new RenderingError(`Include ${match.groups.method} error: ${err.code || err.message}`))}";\n`;
}
Expand Down

0 comments on commit a3f8cb8

Please sign in to comment.