diff --git a/frontend/components/Viewing/Plugin.js b/frontend/components/Viewing/Plugin.js index ea0ef298..23b1c83d 100644 --- a/frontend/components/Viewing/Plugin.js +++ b/frontend/components/Viewing/Plugin.js @@ -17,6 +17,8 @@ export default function Plugin(properties) { const hiddenSections = useSelector(state => state.pageSections.hiddenSections); const dispatch = useDispatch(); + const acceptedTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'a', 'img', 'ul', 'ol', 'li', 'table', 'tr', 'td', 'th', 'thead', 'tbody', 'tfoot', 'caption', 'div', 'span', 'br', 'hr', 'pre', 'code', 'blockquote', 'strong', 'em', 'i', 'b', 'u', 's', 'sub', 'sup', 'del', 'ins', 'mark', 'small', 'big', 'abbr', 'cite', 'dfn', 'kbd', 'q', 'samp', 'var', 'time', 'address', 'article', 'aside', 'footer', 'header', 'nav', 'section', 'main', 'figure', 'figcaption', 'details', 'summary', 'dialog', 'menu', 'menuitem', 'menuitem', 'meter', 'progress', 'output', 'canvas', 'audio', 'video', 'iframe', 'object', 'embed', 'param', 'source', 'track', 'map', 'area', 'form', 'label', 'input', 'button', 'select', 'datalist', 'optgroup', 'option', 'textarea', 'fieldset', 'legend', 'datalist', 'output', 'progress', 'meter', 'details', 'summary', 'command', 'menu', 'menuitem', 'menuitem', 'script', 'noscript', 'style', 'link', 'meta', 'title', 'base', 'head', 'body', 'html', 'br', 'hr', 'wbr', 'img', 'area', 'map', 'track', 'source', 'param', 'iframe', 'embed', 'object', 'canvas', 'script', 'noscript', 'style', 'link', 'meta', 'title', 'base', 'head', 'body', 'html', 'br', 'hr', 'wbr', 'img', 'area', 'map', 'track', 'source', 'param', 'iframe', 'embed', 'object', 'canvas', 'script', 'noscript', 'style', 'link', 'meta', 'title', 'base', 'head', 'body', 'html', 'br', 'hr', 'wbr', 'img', 'area', ] + const uri = properties.uri; @@ -80,6 +82,12 @@ export default function Plugin(properties) { return <>; } + if(!acceptedTags.includes(domNode.name)) { + return ( + <>{domToReact(domNode.children, options)} + ); + } + if(domNode.name === 'html' || domNode.name === 'head' || domNode.name === 'body') { return ( <>{domToReact(domNode.children, options)}