title: Express render function with callback return string and not HTML
body: <p>I'm a nooby user of Nose.JS with express framework and I try to do an engine for HTML with this hierarchy :</p>
  
  <pre><code>&lt;template&gt;
    &lt;layout&gt;
      &lt;view&gt;
    &lt;/layout&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>So, this is my server.js file (croped) :</p>
  
  <pre><code>var express = require('express')
          , http = require('http');
  var app = module.exports = express();
  
  app.configure(function() {
      app.set('views', __dirname + '/views');
      app.set('view engine', 'ejs');
      app.engine('html', require('ejs').renderFile);
  
      app.use(express.favicon());
      app.use(express.static(__dirname + '/public'));
  });
  
  // Routes 
  app.get('/', function(req, res) {
  
      var data = { /* Some data here */ };
  
      /* Probleme start here :
       * I want render the view HTML, 
       * then render the layout HTML with the view content,
       * then render the template to display
       */
  
      res.render('view', data, function(err, view) {
          data.view = view;
          res.render('layout', data, function(err, layout) {
              data.layout = layout;
              res.render('template', data);                
          });           
      });
  });
  </code></pre>
  
  <p>Like I say on the code : 
  I want render the view HTML, then render the layout HTML with the view content, then render the template to display. But <strong>data.view</strong> and <strong>data.layout</strong> are string and not HTML( like : <code>HEADER&lt;br/&gt;Menu&lt;br/&gt;</code>) , so if I put HTML code on this files I have the HTML code on the final page..</p>
  
  <p><strong>-----[EDIT : Add .ejs files]-----</strong></p>
  
  <p><strong>template.ejs</strong></p>
  
  <pre><code>&lt;div&gt;&lt;%= layout %&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>layout.ejs</strong></p>
  
  <pre><code>HEADER&lt;br/&gt;
  Menu&lt;br/&gt;
  &lt;%= view %&gt;
  FOOTER
  </code></pre>
  
  <p><strong>view.ejs</strong></p>
  
  <pre><code>&lt;p&gt;View&lt;/p&gt;
  </code></pre>
  
  <p>How can I get the result of HTML display on <strong>data.view</strong> and <strong>data.layout</strong> ?!</p>
  
  <p>Thank you all and sorry for my English</p>
  
  <p>Arthur</p>