<commit_before>import React, { PropTypes } from 'react';
import { Link } from 'react-router';
import { connect } from 'react-redux';
import { injectIntl } from 'react-intl';
import { createStructuredSelector } from 'reselect';
import Markdown from 'react-markdown';
import Isvg from 'react-inlinesvg';
import styled, {ThemeProvider} from 'styled-components';
import { RouterLink } from 'utils/markdown';

import LanguageThemeProvider from 'components/LanguageThemeProvider';
import ContentBlock from 'components/ContentBlock';

import {
  Caption, Container,
  Content, ContentViewport,
  ToolType
} from 'components/ToolPage/Header';

import { SnapshotText, Viewport, OverlayText, Title } from 'components/ToolPage/Snapshot';

import { BR_IMAGE_PREFIX } from 'containers/Tools/constants';
import TypeOverlay from 'components/TypeOverlay';

import TranslatableStaticText, { injectStaticText } from 'containers/TranslatableStaticText';
import staticText from '../staticText';

export class SnapshotContent extends React.PureComponent {
  constructor() {
    super();
  }

  isType(type, key) {
    return this.props.type === type ||
      (this.props[key] && this.props[key].length > 0);
  }

  render() {

    const { buildMessage } = this.props.translatable;
    const formLink = buildMessage(staticText.expandForm);
    const callToAction = buildMessage((this.props['bt-link'] ? staticText.snapshotBt : staticText.snapshotContribute), {
        'bt-link': this.props['bt-link'],
        'form': formLink
    });

    return (
      <Container backgroundImage={BR_IMAGE_PREFIX+this.props.image}>
        <Viewport showOverflow={this.props['module-type-effective'] !== 'snapshot'}>
          <LanguageThemeProvider>
            <Content id="Content">
              <ContentViewport>
                <ToolType type={this.props.type}>
                  <Link to={`/type/${this.props.type}`}>
                    <TranslatableStaticText {...staticText[this.props.type]} />
                  </Link>
                </ToolType>
                <Title color={'white'}>
                  {this.props.title}
                </Title>
                <SnapshotText>
                  {this.props.snapshot}
                </SnapshotText>
              </ContentViewport>
            </Content>
            <TypeOverlay type={this.props.type} /><commit_msg>Render snapshot popup as markdown<commit_after>import React, { PropTypes } from 'react';
import { Link } from 'react-router';
import { connect } from 'react-redux';
import { injectIntl } from 'react-intl';
import { createStructuredSelector } from 'reselect';
import Markdown from 'react-markdown';
import Isvg from 'react-inlinesvg';
import styled, {ThemeProvider} from 'styled-components';
import { RouterLink } from 'utils/markdown';

import LanguageThemeProvider from 'components/LanguageThemeProvider';
import ContentBlock from 'components/ContentBlock';

import {
  Caption, Container,
  Content, ContentViewport,
  ToolType
} from 'components/ToolPage/Header';

import { SnapshotText, Viewport, OverlayText, Title } from 'components/ToolPage/Snapshot';

import { BR_IMAGE_PREFIX } from 'containers/Tools/constants';
import TypeOverlay from 'components/TypeOverlay';

import TranslatableStaticText, { injectStaticText } from 'containers/TranslatableStaticText';
import staticText from '../staticText';

export class SnapshotContent extends React.PureComponent {
  constructor() {
    super();
  }

  isType(type, key) {
    return this.props.type === type ||
      (this.props[key] && this.props[key].length > 0);
  }

  render() {

    const { buildMessage } = this.props.translatable;
    const formLink = buildMessage(staticText.expandForm);
    const callToAction = buildMessage((this.props['bt-link'] ? staticText.snapshotBt : staticText.snapshotContribute), {
        'bt-link': this.props['bt-link'],
        'form': formLink
    });

    return (
      <Container backgroundImage={BR_IMAGE_PREFIX+this.props.image}>
        <Viewport showOverflow={this.props['module-type-effective'] !== 'snapshot'}>
          <LanguageThemeProvider>
            <Content id="Content">
              <ContentViewport>
                <ToolType type={this.props.type}>
                  <Link to={`/type/${this.props.type}`}>
                    <TranslatableStaticText {...staticText[this.props.type]} />
                  </Link>
                </ToolType>
                <Title color={'white'}>
                  {this.props.title}
                </Title>
                <SnapshotText>
                  <Markdown source={this.props.snapshot} renderers={{Link: RouterLink}} />
                </SnapshotText>
              </ContentViewport>
            </Content>
            <TypeOverlay type={this.props.type} />
{'fraction_non_alphanumeric': 0.12717733473242393, 'fraction_numerical': 0.0004197271773347324, 'mean_word_length': 2.9519071310116085, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 40, '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': '4147638', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1306, 'n_words': 283}