Sanitize Markdown inputs
This commit is contained in:
7033
package-lock.json
generated
Normal file
7033
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -67,6 +67,7 @@
|
|||||||
"redux-immutable": "3.0.8",
|
"redux-immutable": "3.0.8",
|
||||||
"redux-logger": "*",
|
"redux-logger": "*",
|
||||||
"reselect": "2.5.3",
|
"reselect": "2.5.3",
|
||||||
|
"sanitize-html": "^1.14.1",
|
||||||
"serialize-error": "2.0.0",
|
"serialize-error": "2.0.0",
|
||||||
"shallowequal": "0.2.2",
|
"shallowequal": "0.2.2",
|
||||||
"swagger-client": "~3.0.12",
|
"swagger-client": "~3.0.12",
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import Remarkable from "react-remarkable"
|
|
||||||
import React from "react"
|
import React from "react"
|
||||||
|
import Remarkable from "react-remarkable"
|
||||||
|
import sanitize from "sanitize-html"
|
||||||
|
|
||||||
export default function Markdown({ source }) {
|
export default function Markdown({ source }) {
|
||||||
|
const sanitized = sanitize(source)
|
||||||
return <Remarkable
|
return <Remarkable
|
||||||
options={{html: true, typographer: true, linkify: true, linkTarget: "_blank"}}
|
options={{html: true, typographer: true, linkify: true, linkTarget: "_blank"}}
|
||||||
source={source}
|
source={sanitized}
|
||||||
></Remarkable>
|
></Remarkable>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user