From 97170803fab23622314f1a0640af67ce7a243c78 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Sun, 20 Aug 2017 12:41:28 -0600 Subject: [PATCH] Disable all HTML tags in sanitize-html usage --- .../DictionaryDetails/DetailsSection/PhonologyDisplay.jsx | 2 +- src/components/display/DictionaryDetails/index.jsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/display/DictionaryDetails/DetailsSection/PhonologyDisplay.jsx b/src/components/display/DictionaryDetails/DetailsSection/PhonologyDisplay.jsx index b6cff4a..dbb92f1 100644 --- a/src/components/display/DictionaryDetails/DetailsSection/PhonologyDisplay.jsx +++ b/src/components/display/DictionaryDetails/DetailsSection/PhonologyDisplay.jsx @@ -129,7 +129,7 @@ export const PhonologyDisplay = ({ phonologyContent }) => { Exceptions:
diff --git a/src/components/display/DictionaryDetails/index.jsx b/src/components/display/DictionaryDetails/index.jsx index 947b0aa..8f47d87 100644 --- a/src/components/display/DictionaryDetails/index.jsx +++ b/src/components/display/DictionaryDetails/index.jsx @@ -23,7 +23,7 @@ export class DictionaryDetails extends Component { currentDisplay: DISPLAY.NONE, } - this._descriptionHTML = marked(sanitizeHtml(props.description)); + this._descriptionHTML = marked(sanitizeHtml(props.description, { allowedTags: [], allowedAttributes: [], })); } componentWillReceiveProps (nextProps) { @@ -31,7 +31,7 @@ export class DictionaryDetails extends Component { nextDescription = nextProps.description; if (currentDescription !== nextDescription) { - this._descriptionHTML = marked(sanitizeHtml(nextProps.description)); + this._descriptionHTML = marked(sanitizeHtml(nextProps.description, { allowedTags: [], allowedAttributes: [], })); } }