render.js
function renderTemplate(fragment, templateName) {
    if (templateName === 'none') return fragment._txt;
    var t = generator.template$[templateName];
    if (!t) {
      log('Unknown template %s for %s, using default.', templateName, fragment._href);
      t = generator.template$.default;
    }

    var out;
    try { out = t(fragment); }
    catch(err) {
      var msg = u.format('Error rendering %s\n\ntemplate: %s\n',
                         fragment._href, templateName, err.stack || err);
      log(msg);
      out = opts.production ? '' : '<pre>' + esc(msg) + '</pre>';
    }

    return out;
  }
function renderTemplate(fragment, templateName) {
    if (templateName === 'none') return fragment._txt;
    var t = generator.template$[templateName];
    if (!t) {
      log('Unknown template %s for %s, using default.', templateName, fragment._href);
      t = generator.template$.default;
    }

    var out;
    try { out = t(fragment); }
    catch(err) {
      var msg = u.format('Error rendering %s\n\ntemplate: %s\n',
                         fragment._href, templateName, err.stack || err);
      log(msg);
      out = opts.production ? '' : '<pre>' + esc(msg) + '</pre>';
    }

    return out;
  }
function renderTemplate ( fragment , templateName ) { if ( templateName === 'none' ) return fragment . _txt ; var t = generator . template$ [ templateName ] ; if ( ! t ) { log ( 'Unknown template %s for %s, using default.' , templateName , fragment . _href ) ; t = generator . template$ . default ; } var out ; try { out = t ( fragment ) ; } catch ( err ) { var msg = u . format ( 'Error rendering %s\n\ntemplate: %s\n' , fragment . _href , templateName , err . stack || err ) ; log ( msg ) ; out = opts . production ? '' : '<pre>' + esc ( msg ) + '</pre>' ; } return out ; }
template renderer handles missing template and template runtime errors
template renderer handles missing template and template runtime errors