fleau.js
function escapeCurly (text, escapes) {
  var newText = text.slice (0, escapes[0]);
  for (var i = 0; i < escapes.length; i += 3) {
    var from = escapes[i];
    var to = escapes[i + 1];
    var type = escapes[i + 2];
    // Which escape do we have here?
    if (type === 0) {   newText += '{{';
    } else {            newText += '}}';
    }
    newText += text.slice (to, escapes[i+3]);
  }
  return newText;
}
function escapeCurly (text, escapes) {
  var newText = text.slice (0, escapes[0]);
  for (var i = 0; i < escapes.length; i += 3) {
    var from = escapes[i];
    var to = escapes[i + 1];
    var type = escapes[i + 2];
    // Which escape do we have here?
    if (type === 0) {   newText += '{{';
    } else {            newText += '}}';
    }
    newText += text.slice (to, escapes[i+3]);
  }
  return newText;
}
function escapeCurly ( text , escapes ) { var newText = text . slice ( 0 , escapes [ 0 ] ) ; for ( var i = 0 ; i < escapes . length ; i += 3 ) { var from = escapes [ i ] ; var to = escapes [ i + 1 ] ; var type = escapes [ i + 2 ] ; // Which escape do we have here? if ( type === 0 ) { newText += '{{' ; } else { newText += '}}' ; } newText += text . slice ( to , escapes [ i + 3 ] ) ; } return newText ; }
Return a text where all escapes as defined in the toplevel function are indeed escaped.
Return a text where all escapes as defined in the toplevel function are indeed escaped .