Skip to content

Commit

Permalink
Added DOMpurify for security
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio-Riccelli committed Mar 24, 2022
1 parent e10eff1 commit 6a452d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Components/Previewer/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import './index.css';
import { marked } from 'marked';
import dompurify from "dompurify";

marked.setOptions({
breaks: true,
})

export default function Previewer(props) {

let finalString = marked.parse(props.text)
let finalString = dompurify.sanitize(marked.parse(props.text));

return (
<section id="preview-wrapper" >
Expand Down

0 comments on commit 6a452d5

Please sign in to comment.