Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit fb5ced8

Browse files
author
Max Stoiber
committed
Revert "Add language to code blocks when editing messages"
This reverts commit d36c044.
1 parent d36c044 commit fb5ced8

File tree

2 files changed

+2
-304
lines changed

2 files changed

+2
-304
lines changed

shared/draft-utils/state-to-markdown.js

Lines changed: 0 additions & 298 deletions
This file was deleted.

src/components/message/editingBody.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @flow
22
import * as React from 'react';
33
import { convertFromRaw } from 'draft-js';
4-
import stateToMarkdown from 'shared/draft-utils/state-to-markdown.js';
4+
import { stateToMarkdown } from 'draft-js-export-markdown';
55
import type { MessageInfoType } from 'shared/graphql/fragments/message/messageInfo.js';
66
import { Input } from '../chatInput/style';
77
import { EditorInput, EditActions } from './style';
@@ -11,10 +11,6 @@ import { addToastWithTimeout } from 'src/actions/toasts';
1111
import compose from 'recompose/compose';
1212
import { connect } from 'react-redux';
1313
import editMessageMutation from 'shared/graphql/mutations/message/editMessage';
14-
import processMessageContent, {
15-
messageTypeObj,
16-
attachLanguageToCodeBlocks,
17-
} from 'shared/draft-utils/process-message-content';
1814

1915
type Props = {
2016
message: MessageInfoType,
@@ -35,7 +31,7 @@ const EditingChatInput = (props: Props) => {
3531
props.message.messageType === 'text'
3632
? props.message.content.body
3733
: stateToMarkdown(
38-
convertFromRaw(JSON.parse(body)),
34+
convertFromRaw(JSON.parse(props.message.content.body)),
3935
{
4036
gfm: true,
4137
}

0 commit comments

Comments
 (0)