import React, { Component } from 'react';

import { Row, Col, Jumbotron } from 'react-bootstrap';

const Article = ({link, description, title, display_date}) => {

  description = description && description.replace(/<\/?[^>]+(>|$)/g, "");

  return(
    <article>
      <h4>
        <a href={link} target="_blank">{title}</a> &nbsp;
        <small>{display_date}</small>
      </h4>
      <p>{description}</p>
    </article>
  );
};

export default Article;

import React, { Component } from 'react';

const scrubText = (text) => text && text.replace(/(<\/?[^>]+(>|$))|(&(.*?);)/g, "");

const Article = ({link, description, title, display_date}) => {

  return(
    <article>
      <h4>
        <a href={link} target="_blank">{scrubText(title)}</a> &nbsp;
        <small>{display_date}</small>
      </h4>
      <p>{scrubText(description)}</p>
    </article>
  );
};

export default Article;

Scrub article title and description Remove tags and character codes
Scrub article title and description
Remove tags and character codes
