<commit_before>/*eslint-env node */

import React, { Component, PropTypes } from "react";

import { diffWords } from 'diff';

export default class TextDiff extends Component {
    static propTypes = {
        diff: PropTypes.object.isRequired
    };

    render() {
        let { diff: { before, after }} = this.props;
        return (
            <div>
                "
                {before != null &&  after != null ?
                    diffWords(before, after).map((section, index) =>
                        section.added ?
                            <strong key={index}>{section.value}</strong>
                        : section.removed ?
                            <span key={index} style={{ textDecoration: "line-through"}}>{section.value}</span>
                        :
                            <span key={index}>{section.value}</span>
                    )
                : before != null ?
                    <span style={{ textDecoration: "line-through"}}>{before}</span>
                :
                    <strong>{after}</strong>
                }
                "
            </div>
        );
    }
}<commit_msg>Add spaces in text diffs<commit_after>/*eslint-env node */

import React, { Component, PropTypes } from "react";

import { diffWords } from 'diff';

export default class TextDiff extends Component {
    static propTypes = {
        diff: PropTypes.object.isRequired
    };

    render() {
        let { diff: { before, after }} = this.props;
        return (
            <div>
                "
                {before != null &&  after != null ?
                    diffWords(before, after).map((section, index) =>
                        <span>
                        {section.added ?
                            <strong key={index}>{section.value}</strong>
                        : section.removed ?
                            <span key={index} style={{ textDecoration: "line-through"}}>{section.value}</span>
                        :
                            <span key={index}>{section.value}</span>
                        }{" "}
                        </span>
                    )
                : before != null ?
                    <span style={{ textDecoration: "line-through"}}>{before}</span>
                :
                    <strong>{after}</strong>
                }
                "
            </div>
        );
    }
}
{'fraction_non_alphanumeric': 0.12813021702838062, 'fraction_numerical': 0.0, 'mean_word_length': 1.1401785714285715, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, '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': '1371296', 'n_tokens_mistral': 596, 'n_tokens_neox': 569, 'n_words': 118}