mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 22:33:06 +03:00
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:
parent
729802102b
commit
318831f6a9
@ -292,7 +292,8 @@ export const MessageContent = ({ content, contacts, measure, fontSize, group })
|
||||
}}
|
||||
textProps={{style: {
|
||||
fontSize: 'inherit',
|
||||
textDecoration: 'underline'
|
||||
borderBottom: '1px solid',
|
||||
textDecoration: 'none'
|
||||
}}}
|
||||
/>
|
||||
</Box>
|
||||
|
@ -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]} />
|
||||
));
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user