fix: sonarcloud warning and code cleanup

This commit is contained in:
canove
2021-01-15 07:04:01 -03:00
parent 454fd6ce08
commit a0e6b7b2c7
11 changed files with 40 additions and 45 deletions

View File

@@ -161,7 +161,7 @@ const MarkdownWrapper = ({ children }) => {
}
const options = React.useMemo(() => {
const options = {
const markdownOptions = {
disableParsingRawHTML: true,
forceInline: true,
overrides: {
@@ -171,11 +171,11 @@ const MarkdownWrapper = ({ children }) => {
elements.forEach(element => {
if (!allowedElements.includes(element)) {
options.overrides[element] = ({ children }) => children;
markdownOptions.overrides[element] = el => el.children;
}
});
return options;
return markdownOptions;
}, []);
return <Markdown options={options}>{children}</Markdown>;