<commit_before>import React from 'react'
import Avatar from './Avatar'
import { humanDate, present } from '../util/text'
import { sanitize } from 'hylo-utils/text'
var { func, object } = React.PropTypes

class Message extends React.Component {
  static propTypes = {
    message: object.isRequired
  }

  static contextTypes = {
    dispatch: func.isRequired,
    currentUser: object
  }

  render () {
    const { message } = this.props

    const person = message.user
    let text = present(sanitize(message.text))

    return <div className='message' data-message-id={message.id}>
      <a name={`message-${message.id}`}></a>
      <Avatar person={person}/>
      <div className='content'>
        <div>
          <strong className='name'>{sanitize(person.name)}</strong>
          <span className='date'>{humanDate(message.created_at)}</span>
        </div>
        <div className='text'>
          <span dangerouslySetInnerHTML={{__html: text}}/>
        </div>
      </div>
    </div>
  }
}<commit_msg>simple support for newlines in comments<commit_after>import React from 'react'
import Avatar from './Avatar'
import { humanDate, present } from '../util/text'
import { sanitize } from 'hylo-utils/text'
var { func, object } = React.PropTypes

class Message extends React.Component {
  static propTypes = {
    message: object.isRequired
  }

  static contextTypes = {
    dispatch: func.isRequired,
    currentUser: object
  }

  render () {
    const { message } = this.props

    const person = message.user
    let text = present(sanitize(message.text)).replace(/\n/, '<br/>')

    return <div className='message' data-message-id={message.id}>
      <a name={`message-${message.id}`}></a>
      <Avatar person={person}/>
      <div className='content'>
        <div>
          <strong className='name'>{sanitize(person.name)}</strong>
          <span className='date'>{humanDate(message.created_at)}</span>
        </div>
        <div className='text'>
          <span dangerouslySetInnerHTML={{__html: text}}/>
        </div>
      </div>
    </div>
  }
}
{'fraction_non_alphanumeric': 0.15191098209966133, 'fraction_numerical': 0.0, 'mean_word_length': 2.931558935361217, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 36, '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': '1749113', 'n_tokens_mistral': 628, 'n_tokens_neox': 628, 'n_words': 144}