From 8ed43a13297be72473f7dd6899413b7129ee0e0e Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Tue, 4 Jul 2017 19:12:43 -0700 Subject: [PATCH] Ensure OAS3 Markdown fields are sanitized --- src/core/components/providers/markdown.jsx | 20 +++++++++++-------- .../plugins/oas3/wrap-components/markdown.js | 3 ++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/core/components/providers/markdown.jsx b/src/core/components/providers/markdown.jsx index d058d176..7c8806b8 100644 --- a/src/core/components/providers/markdown.jsx +++ b/src/core/components/providers/markdown.jsx @@ -2,15 +2,8 @@ import React, { PropTypes } from "react" import Remarkable from "react-remarkable" import sanitize from "sanitize-html" -const sanitizeOptions = { - textFilter: function(text) { - return text - .replace(/"/g, "\"") - } -} - function Markdown({ source }) { - const sanitized = sanitize(source, sanitizeOptions) + const sanitized = sanitizer(source) return { return source ? ( ) : null})