chat: disallow markdown nodes

Using RemarkBreaks and RemarkDisableTokenizers breaks one or
the other in simultaneous use.

We fall back to escaping markdown tokens we don't want.
This commit is contained in:
Matilde Park 2021-01-22 16:47:22 -05:00
parent 729802102b
commit 318831f6a9
2 changed files with 6 additions and 6 deletions

View File

@ -292,7 +292,8 @@ export const MessageContent = ({ content, contacts, measure, fontSize, group })
}}
textProps={{style: {
fontSize: 'inherit',
textDecoration: 'underline'
borderBottom: '1px solid',
textDecoration: 'none'
}}}
/>
</Box>

View File

@ -53,6 +53,9 @@ const MessageMarkdown = React.memo(props => (
{...props}
unwrapDisallowed={true}
renderers={renderers}
// shim until we uncover why RemarkBreaks and
// RemarkDisableTokenizers can't be loaded simultaneously
disallowedTypes={['heading', 'list', 'listItem']}
allowNode={(node, index, parent) => {
if (
node.type === 'blockquote'
@ -67,11 +70,7 @@ const MessageMarkdown = React.memo(props => (
return true;
}}
plugins={[[
RemarkBreaks,
RemarkDisableTokenizers,
{ block: DISABLED_BLOCK_TOKENS, inline: DISABLED_INLINE_TOKENS }
]]} />
plugins={[RemarkBreaks]} />
));