diff --git a/app/actions/actionsTypes.js b/app/actions/actionsTypes.js index ad8964391..8fda57def 100644 --- a/app/actions/actionsTypes.js +++ b/app/actions/actionsTypes.js @@ -50,7 +50,6 @@ export const SNIPPETED_MESSAGES = createRequestTypes('SNIPPETED_MESSAGES', ['OPE export const DEEP_LINKING = createRequestTypes('DEEP_LINKING', ['OPEN']); export const SORT_PREFERENCES = createRequestTypes('SORT_PREFERENCES', ['SET_ALL', 'SET']); export const NOTIFICATION = createRequestTypes('NOTIFICATION', ['RECEIVED', 'REMOVE']); -export const TOGGLE_MARKDOWN = 'TOGGLE_MARKDOWN'; export const TOGGLE_CRASH_REPORT = 'TOGGLE_CRASH_REPORT'; export const SET_CUSTOM_EMOJIS = 'SET_CUSTOM_EMOJIS'; export const SET_ACTIVE_USERS = 'SET_ACTIVE_USERS'; diff --git a/app/actions/markdown.js b/app/actions/markdown.js deleted file mode 100644 index d33075a38..000000000 --- a/app/actions/markdown.js +++ /dev/null @@ -1,8 +0,0 @@ -import * as types from './actionsTypes'; - -export function toggleMarkdown(value) { - return { - type: types.TOGGLE_MARKDOWN, - payload: value - }; -} diff --git a/app/containers/MessageBox/ReplyPreview.js b/app/containers/MessageBox/ReplyPreview.js index 54d872ebd..a755598be 100644 --- a/app/containers/MessageBox/ReplyPreview.js +++ b/app/containers/MessageBox/ReplyPreview.js @@ -42,7 +42,7 @@ const styles = StyleSheet.create({ }); const ReplyPreview = React.memo(({ - message, Message_TimeFormat, baseUrl, username, useMarkdown, replying, getCustomEmoji, close, theme + message, Message_TimeFormat, baseUrl, username, replying, getCustomEmoji, close, theme }) => { if (!replying) { return null; @@ -67,7 +67,6 @@ const ReplyPreview = React.memo(({ username={username} getCustomEmoji={getCustomEmoji} numberOfLines={1} - useMarkdown={useMarkdown} preview theme={theme} /> @@ -79,7 +78,6 @@ const ReplyPreview = React.memo(({ ReplyPreview.propTypes = { replying: PropTypes.bool, - useMarkdown: PropTypes.bool, message: PropTypes.object.isRequired, Message_TimeFormat: PropTypes.string.isRequired, close: PropTypes.func.isRequired, @@ -90,7 +88,6 @@ ReplyPreview.propTypes = { }; const mapStateToProps = state => ({ - useMarkdown: state.markdown.useMarkdown, Message_TimeFormat: state.settings.Message_TimeFormat, baseUrl: state.server.server }); diff --git a/app/containers/markdown/index.js b/app/containers/markdown/index.js index 0a446ee4b..7e7812bed 100644 --- a/app/containers/markdown/index.js +++ b/app/containers/markdown/index.js @@ -71,7 +71,6 @@ class Markdown extends PureComponent { tmid: PropTypes.string, isEdited: PropTypes.bool, numberOfLines: PropTypes.number, - useMarkdown: PropTypes.bool, customEmojis: PropTypes.bool, useRealName: PropTypes.bool, channels: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), @@ -368,9 +367,7 @@ class Markdown extends PureComponent { } render() { - const { - msg, useMarkdown = true, numberOfLines, preview = false, theme - } = this.props; + const { msg, preview = false } = this.props; if (!msg) { return null; @@ -389,10 +386,6 @@ class Markdown extends PureComponent { return this.renderer.render(ast); } - if (!useMarkdown && !preview) { - return {m}; - } - const ast = parser.parse(m); this.isMessageContainsOnlyEmoji = isOnlyEmoji(m) && emojiCount(m) <= 3; diff --git a/app/containers/message/Attachments.js b/app/containers/message/Attachments.js index dc1f06847..cf3f6106c 100644 --- a/app/containers/message/Attachments.js +++ b/app/containers/message/Attachments.js @@ -8,7 +8,7 @@ import Video from './Video'; import Reply from './Reply'; const Attachments = React.memo(({ - attachments, timeFormat, user, baseUrl, useMarkdown, showAttachment, getCustomEmoji, theme + attachments, timeFormat, user, baseUrl, showAttachment, getCustomEmoji, theme }) => { if (!attachments || attachments.length === 0) { return null; @@ -16,17 +16,17 @@ const Attachments = React.memo(({ return attachments.map((file, index) => { if (file.image_url) { - return ; + return ; } if (file.audio_url) { - return