Skip to content

Commit

Permalink
Merge pull request #4 from WebDevStudios/bug/html-entities-fix
Browse files Browse the repository at this point in the history
Adds support for decoding html entities in post title correctly.
  • Loading branch information
coreymcollins authored Nov 16, 2018
2 parents 2ad1ac4 + 8e580d8 commit 72ff514
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
6 changes: 3 additions & 3 deletions assets/js/components/searchResult.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';

import { decodeEntities } from '@wordpress/html-entities';
export default class SearchResult extends React.Component {

constructor( props ) {
super( props );
}

render() {
render() {
return (
<li className="search-results-item">
<a href={ this.props.result.link }>{ this.props.result.title }</a>
<a href={ this.props.result.link }>{ decodeEntities( this.props.result.title ) }</a>
</li>
)
}
Expand Down
8 changes: 4 additions & 4 deletions assets/js/public.min.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Power up the basic WordPress search field with React.",
"main": "assets/js/public.js",
"dependencies": {
"@wordpress/html-entities": "^2.0.2",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
Expand Down

0 comments on commit 72ff514

Please sign in to comment.