<commit_before>describe('helpers', function() {
  it('helper with complex lookup$', function() {
    var string = '{{#goodbyes}}{{{link ../prefix}}}{{/goodbyes}}';
    var hash = {prefix: '/root', goodbyes: [{text: 'Goodbye', url: 'goodbye'}]};
    var helpers = {link: function(prefix) {
      return '<a href="' + prefix + '/' + this.url + '">' + this.text + '</a>';
    }};
    shouldCompileTo(string, [hash, helpers], '<a href="/root/goodbye">Goodbye</a>');
  });

  it('helper for raw block gets raw content', function() {
    var string = '{{{{raw}}}} {{test}} {{{{/raw}}}}';
    var hash = { test: 'hello' };
    var helpers = { raw: function(options) {
        return options.fn();
    } };
    shouldCompileTo(string, [hash, helpers], ' {{test}} ',
                    'raw block helper gets raw content');
  });

  it('helper for raw block gets parameters', function() {
    var string = '{{{{raw 1 2 3}}}} {{test}} {{{{/raw}}}}';
    var hash = { test: 'hello' };
    var helpers = { raw: function(a, b, c, options) {
        return options.fn() + a + b + c;
    } };
    shouldCompileTo(string, [hash, helpers], ' {{test}} 123',
                    'raw block helper gets raw content');
  });

  it('helper block with complex lookup expression', function() {
    var string = '{{#goodbyes}}{{../name}}{{/goodbyes}}';
    var hash = {name: 'Alan'};
    var helpers = {goodbyes: function(options) {
      var out = '';
      var byes = ['Goodbye', 'goodbye', 'GOODBYE'];
      for (var i = 0, j = byes.length; i < j; i++) {
        out += byes[i] + ' ' + options.fn(this) + '! ';<commit_msg>#1056 Added spec for nested raw block<commit_after>describe('helpers', function() {
  it('helper with complex lookup$', function() {
    var string = '{{#goodbyes}}{{{link ../prefix}}}{{/goodbyes}}';
    var hash = {prefix: '/root', goodbyes: [{text: 'Goodbye', url: 'goodbye'}]};
    var helpers = {link: function(prefix) {
      return '<a href="' + prefix + '/' + this.url + '">' + this.text + '</a>';
    }};
    shouldCompileTo(string, [hash, helpers], '<a href="/root/goodbye">Goodbye</a>');
  });

  it('helper for raw block gets raw content', function() {
    var string = '{{{{raw}}}} {{test}} {{{{/raw}}}}';
    var hash = { test: 'hello' };
    var helpers = { raw: function(options) {
        return options.fn();
    } };
    shouldCompileTo(string, [hash, helpers], ' {{test}} ',
                    'raw block helper gets raw content');
  });

  it('helper for raw block gets parameters', function() {
    var string = '{{{{raw 1 2 3}}}} {{test}} {{{{/raw}}}}';
    var hash = { test: 'hello' };
    var helpers = { raw: function(a, b, c, options) {
        return options.fn() + a + b + c;
    } };
    shouldCompileTo(string, [hash, helpers], ' {{test}} 123',
                    'raw block helper gets raw content');
  });

  it('helper for nested raw block gets raw content', function() {
    var string = '{{{{a}}}} {{{{b}}}} {{{{/b}}}} {{{{/a}}}}';
    var helpers = {
        a: function(options) {
          return options.fn();
      }
    };
    shouldCompileTo(string, [{}, helpers], ' {{{{b}}}} {{{{/b}}}} ');
  });

  it('helper block with complex lookup expression', function() {
    var string = '{{#goodbyes}}{{../name}}{{/goodbyes}}';
    var hash = {name: 'Alan'};
    var helpers = {goodbyes: function(options) {
      var out = '';
      var byes = ['Goodbye', 'goodbye', 'GOODBYE'];
      for (var i = 0, j = byes.length; i < j; i++) {
        out += byes[i] + ' ' + options.fn(this) + '! ';
{'fraction_non_alphanumeric': 0.22704081632653061, 'fraction_numerical': 0.00510204081632653, 'mean_word_length': 2.869517543859649, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3573746', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1156, 'n_words': 327}