include the plaintext representation of a pill within it
parent
410a1683fe
commit
d7c2c8ba7b
|
@ -20,7 +20,7 @@ import PropTypes from 'prop-types';
|
||||||
import type SyntheticKeyboardEvent from 'react/lib/SyntheticKeyboardEvent';
|
import type SyntheticKeyboardEvent from 'react/lib/SyntheticKeyboardEvent';
|
||||||
|
|
||||||
import { Editor } from 'slate-react';
|
import { Editor } from 'slate-react';
|
||||||
import { Value, Document, Event, Inline, Range, Node } from 'slate';
|
import { Value, Document, Event, Inline, Text, Range, Node } from 'slate';
|
||||||
|
|
||||||
import Html from 'slate-html-serializer';
|
import Html from 'slate-html-serializer';
|
||||||
import { Markdown as Md } from 'slate-md-serializer';
|
import { Markdown as Md } from 'slate-md-serializer';
|
||||||
|
@ -781,6 +781,7 @@ export default class MessageComposerInput extends React.Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Use the original contentState because `contentText` has had mentions
|
// Use the original contentState because `contentText` has had mentions
|
||||||
// stripped and these need to end up in contentHTML.
|
// stripped and these need to end up in contentHTML.
|
||||||
|
|
||||||
|
@ -1014,14 +1015,14 @@ export default class MessageComposerInput extends React.Component {
|
||||||
if (href) {
|
if (href) {
|
||||||
inline = Inline.create({
|
inline = Inline.create({
|
||||||
type: 'pill',
|
type: 'pill',
|
||||||
isVoid: true,
|
|
||||||
data: { url: href },
|
data: { url: href },
|
||||||
|
nodes: [Text.create(completion)],
|
||||||
});
|
});
|
||||||
} else if (completion === '@room') {
|
} else if (completion === '@room') {
|
||||||
inline = Inline.create({
|
inline = Inline.create({
|
||||||
type: 'pill',
|
type: 'pill',
|
||||||
isVoid: true,
|
|
||||||
data: { type: Pill.TYPE_AT_ROOM_MENTION },
|
data: { type: Pill.TYPE_AT_ROOM_MENTION },
|
||||||
|
nodes: [Text.create(completion)],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1262,7 +1263,6 @@ export default class MessageComposerInput extends React.Component {
|
||||||
blockStyleFn={MessageComposerInput.getBlockStyle}
|
blockStyleFn={MessageComposerInput.getBlockStyle}
|
||||||
keyBindingFn={MessageComposerInput.getKeyBinding}
|
keyBindingFn={MessageComposerInput.getKeyBinding}
|
||||||
handleKeyCommand={this.handleKeyCommand}
|
handleKeyCommand={this.handleKeyCommand}
|
||||||
handleReturn={this.handleReturn}
|
|
||||||
handlePastedText={this.onTextPasted}
|
handlePastedText={this.onTextPasted}
|
||||||
handlePastedFiles={this.props.onFilesPasted}
|
handlePastedFiles={this.props.onFilesPasted}
|
||||||
stripPastedStyles={!this.state.isRichtextEnabled}
|
stripPastedStyles={!this.state.isRichtextEnabled}
|
||||||
|
|
Loading…
Reference in New Issue