Add filter to un-double-escape quotation marks
This commit is contained in:
@@ -2,8 +2,15 @@ import React, { PropTypes } from "react"
|
|||||||
import Remarkable from "react-remarkable"
|
import Remarkable from "react-remarkable"
|
||||||
import sanitize from "sanitize-html"
|
import sanitize from "sanitize-html"
|
||||||
|
|
||||||
|
const sanitizeOptions = {
|
||||||
|
textFilter: function(text) {
|
||||||
|
return text
|
||||||
|
.replace(/"/g, "\"")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function Markdown({ source }) {
|
function Markdown({ source }) {
|
||||||
const sanitized = sanitize(source)
|
const sanitized = sanitize(source, sanitizeOptions)
|
||||||
return <Remarkable
|
return <Remarkable
|
||||||
options={{html: true, typographer: true, linkify: true, linkTarget: "_blank"}}
|
options={{html: true, typographer: true, linkify: true, linkTarget: "_blank"}}
|
||||||
source={sanitized}
|
source={sanitized}
|
||||||
|
|||||||
Reference in New Issue
Block a user