<commit_before>import React, {Component} from 'react';
import moment from 'moment';
import Markdown from 'react-markdown';

// utils
import request from '../../common/utils/request.js';
import api from '../../common/utils/api.js';

// style
import style from './detail.css';


class ArtcDetail extends Component {
  constructor(props) {
    super(props);

    this.state = {
      detail: {
        Id: null,
        Title: '',
        Subtitle: '',
        Content: '',
        Views: 0,
        Source: '',
        Publishtime: 0,
        Poster: null
      }
    };
  }

  componentDidMount() {
    const {Id} = this.props.location.state;
    request({
      url: api.article.detail,
      data: {Id},
      method: 'POST',
    }).then(res => {
      this.setState({detail: res});
    });
  }

  render() {
    const {Title, Subtitle, Content, Views, Source, Publishtime, Poster} = this.state.detail;
    var posterHeigth = (document.documentElement.clientHeight - 90 - 54) + 'px';
    return (
      <div className={style.detail}>
        <div className={style.poster}
          style={{backgroundImage: "url("+Poster+")", height: posterHeigth}}
        >
          <div className={style.mask}>
            <div className={style.titleWrapper}><div className={style.title}>{Title}</div></div>
          </div>
        </div>
        <div className={style.body}>
          <div className={style.subtitle}>{Subtitle}</div>
          <Markdown className="markdownBody" escapeHtml={true} source={Content} />
          <div className={style.info}>{`${Views} - ${Source} - ${moment(parseInt(Publishtime, 0)).format('MMMM Do YYYY')}`}</div>
        </div>
      </div>
    );
  }
}

export default ArtcDetail;<commit_msg>block the empty url request caused by background-image<commit_after>import React, {Component} from 'react';
import moment from 'moment';
import Markdown from 'react-markdown';

// utils
import request from '../../common/utils/request.js';
import api from '../../common/utils/api.js';

// style
import style from './detail.css';


class ArtcDetail extends Component {
  constructor(props) {
    super(props);

    this.state = {
      detail: {
        Id: null,
        Title: '',
        Subtitle: '',
        Content: '',
        Views: 0,
        Source: '',
        Publishtime: 0,
        Poster: null
      }
    };
  }

  componentDidMount() {
    const {Id} = this.props.location.state;
    request({
      url: api.article.detail,
      data: {Id},
      method: 'POST',
    }).then(res => {
      this.setState({detail: res});
    });
  }

  render() {
    const {Title, Subtitle, Content, Views, Source, Publishtime, Poster} = this.state.detail;
    var posterHeigth = (document.documentElement.clientHeight - 90 - 54) + 'px';
    return (
      <div className={style.detail}>
        {this.Poster ? 
          <div className={style.poster}
            style={{backgroundImage: "url("+Poster+")", height: posterHeigth}}
          >
            <div className={style.mask}>
              <div className={style.titleWrapper}><div className={style.title}>{Title}</div></div>
            </div>
          </div> : null
        }
        <div className={style.body}>
          <div className={style.subtitle}>{Subtitle}</div>
          <Markdown className="markdownBody" escapeHtml={true} source={Content} />
          <div className={style.info}>{`${Views} - ${Source} - ${moment(parseInt(Publishtime, 0)).format('MMMM Do YYYY')}`}</div>
        </div>
      </div>
    );
  }
}

export default ArtcDetail;
{'fraction_non_alphanumeric': 0.1671388101983003, 'fraction_numerical': 0.00396600566572238, 'mean_word_length': 2.4148936170212765, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, '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': '4305510', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1071, 'n_words': 234}