Skip to content

Commit

Permalink
Merge pull request #17 from Budgee/patch
Browse files Browse the repository at this point in the history
Decode entities in text nodes
  • Loading branch information
peternewnham committed Aug 9, 2017
2 parents 404ed57 + 4d54d1a commit f712b9e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions demo/src/js/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,3 @@ Editor.propTypes = {
initialHtml: PropTypes.string.isRequired,
onUpdateClick: PropTypes.func.isRequired
};

export default Editor;
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 f712b9e

Please sign in to comment.