<commit_before>import DocumentTitle from "react-document-title"
import {injectIntl, intlShape, FormattedDate} from 'react-intl';
import React, {PropTypes} from "react"

import config from "../config"
import * as AppPropTypes from "../app-prop-types"
import ExternalLink from "./external-link"
import Scale from "./scale"
import getDayBefore from "../periods"

const Parameter = React.createClass({
  propTypes: {
    countryPackageName: PropTypes.string.isRequired,
    countryPackageVersion: PropTypes.string.isRequired,
    intl: intlShape.isRequired,
    parameter: AppPropTypes.parameter.isRequired,
  },
  render() {
    const {parameter} = this.props
    const description = parameter.description || "Aucune description"
    const isScale = (! parameter.values)
    //Add soft hyphens to break long parameter id before dots
    //const multilineId = parameter.id.replace(/\./g, '\u200b.')
    const multilineId = '<span>' + parameter.id.replace(/\./g, '</span><span>.') + '</span>'

    return (
      <DocumentTitle title={`${parameter.id} - Explorateur de la législation`}>
        <div>
          <header className="page-header">
            <h1><code dangerouslySetInnerHTML={{__html: multilineId}}></code></h1>
            <p className="description">{description}</p>
          </header>
          <div className="row">
            <div className="col-lg-8">
              {
                isScale
                  ? <Scale parameter={parameter} />
                  : this.renderStartStopValueTable(parameter, parameter.values)
              }
            </div>
          </div>
          <hr/>
          <ExternalLink href={`${config.apiBaseUrl}/parameter/${parameter.id}`}>
            Donnée brute au format JSON
          </ExternalLink>
        </div>
      </DocumentTitle>
    )<commit_msg>Replace soft hyphens by work breaks in parameters' titles<commit_after>import DocumentTitle from "react-document-title"
import {injectIntl, intlShape, FormattedDate} from 'react-intl';
import React, {PropTypes} from "react"

import config from "../config"
import * as AppPropTypes from "../app-prop-types"
import ExternalLink from "./external-link"
import Scale from "./scale"
import getDayBefore from "../periods"

const Parameter = React.createClass({
  propTypes: {
    countryPackageName: PropTypes.string.isRequired,
    countryPackageVersion: PropTypes.string.isRequired,
    intl: intlShape.isRequired,
    parameter: AppPropTypes.parameter.isRequired,
  },
  render() {
    const {parameter} = this.props
    const description = parameter.description || "Aucune description"
    const isScale = (! parameter.values)
    //Add word break opportunities before dots for long parameter id
    const multilineId = parameter.id.replace(/\./g, '<wbr>.')

    return (
      <DocumentTitle title={`${parameter.id} - Explorateur de la législation`}>
        <div>
          <header className="page-header">
            <h1><code dangerouslySetInnerHTML={{__html: multilineId}}></code></h1>
            <p className="description">{description}</p>
          </header>
          <div className="row">
            <div className="col-lg-8">
              {
                isScale
                  ? <Scale parameter={parameter} />
                  : this.renderStartStopValueTable(parameter, parameter.values)
              }
            </div>
          </div>
          <hr/>
          <ExternalLink href={`${config.apiBaseUrl}/parameter/${parameter.id}`}>
            Donnée brute au format JSON
          </ExternalLink>
        </div>
      </DocumentTitle>
    )
{'fraction_non_alphanumeric': 0.1304833752444817, 'fraction_numerical': 0.002514668901927913, 'mean_word_length': 2.5871743486973946, 'pattern_counts': {'":': 0, '<': 48, '<?xml version=': 0, '>': 48, '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': '1527221', 'n_tokens_mistral': 984, 'n_tokens_neox': 973, 'n_words': 238}