Skip to content

Commit

Permalink
Merge branch 'pr-1058'
Browse files Browse the repository at this point in the history
* pr-1058:
  fix linting errors
  Fix rendering of error message
  Modified error message
  Add try-catch to the footer parsing methods—issue 836.
  • Loading branch information
jameshadfield committed Apr 15, 2020
2 parents a64f9ba + a36d3c1 commit de76879
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/framework/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,16 @@ export const getAcknowledgments = (metadata, dispatch) => {
KEEP_CONTENT: false,
ALLOW_DATA_ATTR: false
};
const rawDescription = marked(metadata.description);
const cleanDescription = sanitizer(rawDescription, sanitizerConfig);

let cleanDescription;
try {
const rawDescription = marked(metadata.description);
cleanDescription = sanitizer(rawDescription, sanitizerConfig);
} catch (error) {
console.error(`Error parsing footer description: ${error}`);
cleanDescription = '<p>There was an error parsing the footer description.</p>';
}

return (
<div
className='acknowledgments'
Expand Down

0 comments on commit de76879

Please sign in to comment.