<commit_before>'use strict';

var React = require('react');

var LintResults = React.createClass({
  getInitialState: function() {
    return {};
  },

  componentDidMount: function() {
  },

  buildResult: function() {
    var p = 0;
    var loc = 0;
    var result = '';
    while(loc < this.props.result.text.length) {
      var point = this.props.result.result[p];
      if(p < this.props.result.result.length && loc === point.index + point.offset) {
        result += '<sup>' + (p + 1) + '</sup>';
        p++;
      }
      else {
        result += this.props.result.text.charAt(loc);
        loc++;
      }
    }
    return result;
  },

  render: function() {
    console.log('result',this.props.result);
    if(this.props.result) {
      return (
        <div>
          <p>{this.buildResult()}</p>
          <ol>
          {
            this.props.result.result.map(function(point, index) {
              return <li key={index}>{point.reason}</li>;
            })
          }
          </ol>
        </div>
      );
    }
    else {
      return (<div></div>);
    }
  }
});<commit_msg>inject html into result<commit_after>'use strict';

var React = require('react');

var LintResults = React.createClass({
  getInitialState: function() {
    return {};
  },

  componentDidMount: function() {
  },

  buildResult: function() {
    var p = 0;
    var loc = 0;
    var result = '';
    while(loc < this.props.result.text.length) {
      var point = this.props.result.result[p];
      if(p < this.props.result.result.length && loc === point.index + point.offset) {
        result += '<sup>' + (p + 1) + '</sup>';
        p++;
      }
      else {
        result += this.props.result.text.charAt(loc);
        loc++;
      }
    }
    return result;
  },

  render: function() {
    console.log('result',this.props.result);
    if(this.props.result) {
      return (
        <div>
          <p dangerouslySetInnerHTML={{__html: this.buildResult()}} />
          <ol>
          {
            this.props.result.result.map(function(point, index) {
              return <li key={index}>{point.reason}</li>;
            })
          }
          </ol>
        </div>
      );
    }
    else {
      return (<div></div>);
    }
  }
});
{'fraction_non_alphanumeric': 0.174496644295302, 'fraction_numerical': 0.0026845637583892616, 'mean_word_length': 1.819672131147541, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 26, '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': '5505253', 'n_tokens_mistral': 725, 'n_tokens_neox': 711, 'n_words': 131}