<commit_before>/*
 * Copyright (C) 2015-2016 Actor LLC. <https://actor.im>
 */

import React, { Component, PropTypes } from 'react';
import { findDOMNode } from 'react-dom';
import hljs from 'highlight.js';
import ActorClient from '../../../utils/ActorClient';

import { processEmojiText } from '../../../utils/EmojiUtils';

function processText(text) {
  let processedText = text;
  processedText = ActorClient.renderMarkdown(processedText);
  processedText = processEmojiText(processedText);

  return processedText;
}

class Text extends Component {
  static propTypes = {
    text: PropTypes.string.isRequired,
    className: PropTypes.string
  };

  componentDidMount() {
    requestAnimationFrame(() => {
      const node = findDOMNode(this);
      const codeBlocks = node.getElementsByTagName('pre');
      for (let i = 0; i < codeBlocks.length; i++) {
        const codeBlock = codeBlocks[i];
        hljs.highlightBlock(codeBlock.firstChild);
      }
    });
  }

  render() {
    const { text, className } = this.props;

    return (
      <div className={className}>
        <div className="text" dangerouslySetInnerHTML={{__html: processText(text)}}/>
      </div>
    );
  }
}

export default Text;<commit_msg>fix(web): disable hljs<commit_after>/*
 * Copyright (C) 2015-2016 Actor LLC. <https://actor.im>
 */

import React, { Component, PropTypes } from 'react';
import { findDOMNode } from 'react-dom';
import hljs from 'highlight.js';
import ActorClient from '../../../utils/ActorClient';

import { processEmojiText } from '../../../utils/EmojiUtils';

function processText(text) {
  let processedText = text;
  processedText = ActorClient.renderMarkdown(processedText);
  processedText = processEmojiText(processedText);

  return processedText;
}

class Text extends Component {
  static propTypes = {
    text: PropTypes.string.isRequired,
    className: PropTypes.string
  };

  componentDidMount() {
    /*
    requestAnimationFrame(() => {
      const node = findDOMNode(this);
      const codeBlocks = node.getElementsByTagName('pre');
      for (let i = 0; i < codeBlocks.length; i++) {
        const codeBlock = codeBlocks[i];
        hljs.highlightBlock(codeBlock.firstChild);
      }
    });
    */
  }

  render() {
    const { text, className } = this.props;

    return (
      <div className={className}>
        <div className="text" dangerouslySetInnerHTML={{__html: processText(text)}}/>
      </div>
    );
  }
}

export default Text;
{'fraction_non_alphanumeric': 0.14135277440259214, 'fraction_numerical': 0.007290400972053463, 'mean_word_length': 3.2956521739130435, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '136839', 'n_tokens_mistral': 760, 'n_tokens_neox': 734, 'n_words': 171}