<commit_before>describe('mwMarkdown', function () {
  var $compile,
    $rootScope;

  beforeEach(module('ngSanitize'));
  beforeEach(module('btford.markdown'));
  beforeEach(module('mwUI'));

  beforeEach(inject(function (_$compile_, _$rootScope_) {
    $compile = _$compile_;
    $rootScope = _$rootScope_;
  }));

  var markdownWithError = '<h1>dfgdfg</ <#h1 hjhtjhsd';


  it('should convert transcluded text to markdown', function () {
    var elt = angular.element('<mw-markdown>*hi*</mw-markdown>');
    $compile(elt)($rootScope);
    expect(elt.html()).toBe('<p><em>hi</em></p>');

    var elt = angular.element('<div mw-markdown>*hi*</div>');
    $compile(elt)($rootScope);
    expect(elt.html()).toBe('<p><em>hi</em></p>');
  });

  it('should not convert transcluded text with error to markdown', function () {
    var elt = angular.element('<mw-markdown>' + markdownWithError + '</mw-markdown>');
    $compile(elt)($rootScope);
    expect(elt.html()).toBe('<p>dfgdfg</p>');
  });

  it('should convert text as attribute to markdown', function () {
    var elt = angular.element('<div mw-markdown="hey"></div>');
    $compile(elt)($rootScope);
    expect(elt.html()).toBe('');

    $rootScope.hey = "*hi*";
    $rootScope.$apply();
    expect(elt.html()).toBe('<p><em>hi</em></p>');
  });

  it('should not convert text with error as attribute to markdown', function () {
    var elt = angular.element('<div mw-markdown="hey"></div>');
    $compile(elt)($rootScope);
    $rootScope.hey = markdownWithError;
    $rootScope.$apply();
    expect(elt.html()).toBe('&lt;h1&gt;dfgdfg&lt;/ &lt;#h1 hjhtjhsd');
  });

  it('should sanitize text', function () {
    var elt = angular.element('<div mw-markdown><script>window.hacked = true;</script></div mw-markdown>');
    $compile(elt)($rootScope);
    expect(elt.html()).toBe('<p>window.hacked = true;</p>');
    expect(window.hacked).toBeUndefined();
  });

});
<commit_msg>removes test case because $sanitize has been changed for ng 1.5 it does not throw an error anymore<commit_after>describe('mwMarkdown', function () {
  var $compile,
    $rootScope;

  beforeEach(module('ngSanitize'));
  beforeEach(module('btford.markdown'));
  beforeEach(module('mwUI'));

  beforeEach(inject(function (_$compile_, _$rootScope_) {
    $compile = _$compile_;
    $rootScope = _$rootScope_;
  }));

  var markdownWithError = '<script>dfgdfg</ <#h1 hjhtjhsd';


  it('should convert transcluded text to markdown', function () {
    var elt = angular.element('<mw-markdown>*hi*</mw-markdown>');
    $compile(elt)($rootScope);
    expect(elt.html()).toBe('<p><em>hi</em></p>');

    var elt = angular.element('<div mw-markdown>*hi*</div>');
    $compile(elt)($rootScope);
    expect(elt.html()).toBe('<p><em>hi</em></p>');
  });

  it('should not convert transcluded text with error to markdown', function () {
    var elt = angular.element('<mw-markdown>' + markdownWithError + '</mw-markdown>');
    $compile(elt)($rootScope);
    expect(elt.html()).toBe('<p>dfgdfg</p>');
  });

  it('should convert text as attribute to markdown', function () {
    var elt = angular.element('<div mw-markdown="hey"></div>');
    $compile(elt)($rootScope);
    expect(elt.html()).toBe('');

    $rootScope.hey = "*hi*";
    $rootScope.$apply();
    expect(elt.html()).toBe('<p><em>hi</em></p>');
  });

  it('should sanitize text', function () {
    var elt = angular.element('<div mw-markdown><script>window.hacked = true;</script></div mw-markdown>');
    $compile(elt)($rootScope);
    expect(elt.html()).toBe('<p>window.hacked = true;</p>');
    expect(window.hacked).toBeUndefined();
  });

});

{'fraction_non_alphanumeric': 0.21713970790851475, 'fraction_numerical': 0.0019289060347203086, 'mean_word_length': 4.458646616541353, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 63, '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': '7567536', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1218, 'n_words': 213}