ruby-ejs icon indicating copy to clipboard operation
ruby-ejs copied to clipboard

Added "subtemplating" for lack of a better work

Open malomalo opened this issue 10 years ago • 0 comments

The following changes allow the following:

Giving this function

formTag = function (template) {
  return '<form>\n'+template()+'\n</form>';
}

The following ejs template:

<%= formTag(function () { %>
    <input type="submit" />
<% }) %>

generates:

<form>
    <input type="submit" />
</form>

malomalo avatar Oct 27 '14 17:10 malomalo