Skip to content

Commit

Permalink
bug(searchPage): fix broken search results
Browse files Browse the repository at this point in the history
- fix long search result text

[#162982445]
  • Loading branch information
KvNGCzA committed Jan 4, 2019
1 parent bbdb77b commit 5d3f83b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/SearchPage/SearchPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import makeAnimated from 'react-select/lib/animated';
import queryString from 'query-string';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import HtmlToReact from 'html-to-react';


import Pagination from '../common/Pagination';
import constructQuery from '../../utils/constructQuery';
Expand All @@ -14,6 +16,7 @@ import { fetchTagTitles } from '../../actions/tagActions';
import fetchAuthors from '../../actions/authorsActions';
import searchActions from '../../actions/searchActions';

const HtmlToReactParser = new HtmlToReact.Parser();

export const Filters = (props) => {
const {
Expand Down Expand Up @@ -244,8 +247,10 @@ export class SearchPage extends Component {
{
articles.map((article, index) => (
<div key={String(index)} className="result">
<h6><Link to={`/articles/${article.id}`}>{article.title}</Link></h6>
<p className="excerpt">{article.body}</p>
<h6><Link to={`/articles/${article.id}`}>{HtmlToReactParser.parse(article.title)}</Link></h6>
<p className="excerpt">
{HtmlToReactParser.parse(article.body.slice(0, 200))}
</p>
</div>
))
}
Expand Down

0 comments on commit 5d3f83b

Please sign in to comment.