Skip to content

Commit

Permalink
protect fromMarkdown
Browse files Browse the repository at this point in the history
  • Loading branch information
abulte committed Jan 2, 2024
1 parent e1039ea commit 7f24815
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const descriptionFromMarkdown = (ref, attr = 'description') => {
* @param {string} value
*/
export const fromMarkdown = (value) => {
if (!value) return ''
const parsed = marked.parse(value, { mangle: false, headerIds: false })
return DOMPurify.sanitize(parsed)
}
Expand Down

0 comments on commit 7f24815

Please sign in to comment.