diff --git a/app/components/markdown/markdown.tsx b/app/components/markdown/markdown.tsx index a7efb3a11..043709715 100644 --- a/app/components/markdown/markdown.tsx +++ b/app/components/markdown/markdown.tsx @@ -1,6 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {useManagedConfig} from '@mattermost/react-native-emm'; import {Parser, Node} from 'commonmark'; import Renderer from 'commonmark-react-renderer'; import React, {ReactElement, useMemo, useRef} from 'react'; @@ -131,6 +132,7 @@ const Markdown = ({ textStyles = {}, theme, value = '', baseParagraphStyle, }: MarkdownProps) => { const style = getStyleSheet(theme); + const managedConfig = useManagedConfig(); const urlFilter = (url: string) => { const scheme = getScheme(url); @@ -471,10 +473,14 @@ const Markdown = ({ }; const renderText = ({context, literal}: MarkdownBaseRenderer) => { + const selectable = (managedConfig.copyAndPasteProtection !== 'true') && context.includes('table_cell'); if (context.indexOf('image') !== -1) { // If this text is displayed, it will be styled by the image component return ( - + {literal} ); @@ -496,6 +502,7 @@ const Markdown = ({ {literal} diff --git a/app/components/markdown/markdown_table_cell/index.tsx b/app/components/markdown/markdown_table_cell/index.tsx index 2da575947..3fb8eb717 100644 --- a/app/components/markdown/markdown_table_cell/index.tsx +++ b/app/components/markdown/markdown_table_cell/index.tsx @@ -24,6 +24,11 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { justifyContent: 'flex-start', padding: 8, }, + textContainer: { + flexDirection: 'row', + alignItems: 'center', + flexWrap: 'wrap', + }, cellRightBorder: { borderRightWidth: 1, }, @@ -57,7 +62,9 @@ const MarkdownTableCell = ({isLastCell, align, children}: MarkdownTableCellProps style={[cellStyle, textStyle]} testID='markdown_table_cell' > - {children} + + {children} + ); }; diff --git a/app/components/post_list/post/system_message/__snapshots__/system_message_helpers.test.js.snap b/app/components/post_list/post/system_message/__snapshots__/system_message_helpers.test.js.snap index 04c7ab01b..8d4456556 100644 --- a/app/components/post_list/post/system_message/__snapshots__/system_message_helpers.test.js.snap +++ b/app/components/post_list/post/system_message/__snapshots__/system_message_helpers.test.js.snap @@ -44,6 +44,7 @@ exports[`renderSystemMessage uses renderer for Channel Display Name update 1`] = {value} diff --git a/app/screens/code/index.tsx b/app/screens/code/index.tsx index 991360a6e..a237bd028 100644 --- a/app/screens/code/index.tsx +++ b/app/screens/code/index.tsx @@ -31,7 +31,7 @@ const Code = ({code, language, textStyle}: Props) => {