diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 799e21d66..57bee68ca 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -15,6 +15,7 @@ const Frame = require('react-frame-component').default; const dedent = require('dedent-tabs').default; const DOMPurify = require('dompurify'); +const purifyConfig = { FORCE_BODY: true, ADD_ATTR: ['style'] }; const Themes = require('themes/themes.json'); @@ -35,8 +36,7 @@ const BrewPage = (props)=>{ index : 0, ...props }; - const cleanText = DOMPurify.sanitize(props.contents); - // console.log(DOMPurify.removed); + const cleanText = DOMPurify.sanitize(props.contents, purifyConfig); return
; @@ -125,8 +125,7 @@ const BrewRenderer = (props)=>{ const renderStyle = ()=>{ if(!props.style) return; - const cleanStyle = DOMPurify.sanitize(props.style); - // console.log(DOMPurify.removed); + const cleanStyle = DOMPurify.sanitize(props.style, purifyConfig); //return
@layer styleTab {\n${sanitizeScriptTags(props.style)}\n} ` }} />; return
${cleanStyle} ` }} />; };