Sanitize Markdown inputs

This commit is contained in:
Kyle Shockey
2017-06-01 22:14:44 -07:00
parent 23b1a8aabd
commit af2b1e20f1
3 changed files with 7038 additions and 3 deletions

View File

@@ -1,10 +1,11 @@
import Remarkable from "react-remarkable"
import React from "react"
import Remarkable from "react-remarkable"
import sanitize from "sanitize-html"
export default function Markdown({ source }) {
const sanitized = sanitize(source)
return <Remarkable
options={{html: true, typographer: true, linkify: true, linkTarget: "_blank"}}
source={source}
source={sanitized}
></Remarkable>
}