Merge branch 'mp/hotfix/2021-1-22' (#4327)

* origin/mp/hotfix/2021-1-22:
  chat: disallow markdown links
  landscape: downgrade formik to 2.1.5
  chat: disallow markdown nodes

Signed-off-by: Matilde Park <matilde.park@gmail.com>
This commit is contained in:
Matilde Park 2021-01-22 17:06:08 -05:00
commit 8b4aa8755f
4 changed files with 553 additions and 2569 deletions

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@
"codemirror": "^5.59.2", "codemirror": "^5.59.2",
"css-loader": "^3.6.0", "css-loader": "^3.6.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"formik": "^2.2.6", "formik": "^2.1.5",
"immer": "^8.0.1", "immer": "^8.0.1",
"lodash": "^4.17.20", "lodash": "^4.17.20",
"markdown-to-jsx": "^6.11.4", "markdown-to-jsx": "^6.11.4",

View File

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

View File

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