Skip to content

Commit

Permalink
add decode entities in text nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Bell committed Aug 6, 2017
1 parent 8708dea commit 4d54d1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/HtmlParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import ProcessNodes from './utils/ProcessNodes';
* @returns {Array} List of top level React elements
*/
export default function HtmlParser(html) {
const nodes = htmlparser2.parseDOM(html);
const nodes = htmlparser2.parseDOM(html, {decodeEntities: true});
return ProcessNodes(nodes);
}
2 changes: 1 addition & 1 deletion test/unit/HtmlParser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Testing: `HtmlParser`', () => {

it('should parse the html string and process the resulting nodes', () => {
expect(HtmlParser('html')).toBe('processed');
expect(htmlparser2.parseDOM).toHaveBeenCalledWith('html');
expect(htmlparser2.parseDOM).toHaveBeenCalledWith('html', {decodeEntities: true});
expect(ProcessNodes).toHaveBeenCalledWith('parsed');
});

Expand Down

0 comments on commit 4d54d1a

Please sign in to comment.