<commit_before>import PropTypes from 'prop-types';
import emojify from '../../../emoji';
const loadScriptOnce = require('load-script-once');

class LivePreview extends React.PureComponent {

  componentDidUpdate() {
    const node  = ReactDOM.findDOMNode(this);
    if (MathJax != undefined) {
	  MathJax.Hub.Queue(["Typeset", MathJax.Hub, node]);
    }
  }
  
  render () {
    const text = this.props.text.replace(/\n/, '<br>');
    return <div dangerouslySetInnerHTML={{ __html: emojify(text)}} />
  }

}
<commit_msg>live preview: replace new line*s* to br tag*s*<commit_after>import PropTypes from 'prop-types';
import emojify from '../../../emoji';
const loadScriptOnce = require('load-script-once');

class LivePreview extends React.PureComponent {

  componentDidUpdate() {
    const node  = ReactDOM.findDOMNode(this);
    if (MathJax != undefined) {
	  MathJax.Hub.Queue(["Typeset", MathJax.Hub, node]);
    }
  }
  
  render () {
    const text = this.props.text.replace(/\n/g, '<br>');
    return <div dangerouslySetInnerHTML={{ __html: emojify(text)}} />
  }

}

{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.0, 'mean_word_length': 3.6739130434782608, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '261708', 'n_tokens_mistral': 359, 'n_tokens_neox': 360, 'n_words': 77}