first impl of inline formatting
This commit is contained in:
parent
e7db660820
commit
d4c7992f5a
1 changed files with 9 additions and 5 deletions
|
@ -455,22 +455,26 @@ export default class BasicMessageEditor extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
_formatBold = () => {
|
||||
_wrapSelection(prefix, suffix = prefix) {
|
||||
const {partCreator} = this.props.model;
|
||||
this._replaceSelection(range => {
|
||||
const parts = range.parts;
|
||||
parts.splice(0, 0, partCreator.plain("**"));
|
||||
parts.push(partCreator.plain("**"));
|
||||
parts.splice(0, 0, partCreator.plain(prefix));
|
||||
parts.push(partCreator.plain(suffix));
|
||||
return parts;
|
||||
});
|
||||
}
|
||||
|
||||
_formatItalic = () => {
|
||||
_formatBold = () => {
|
||||
this._wrapSelection("**");
|
||||
}
|
||||
|
||||
_formatItalic = () => {
|
||||
this._wrapSelection("*");
|
||||
}
|
||||
|
||||
_formatStrikethrough = () => {
|
||||
|
||||
this._wrapSelection("<del>", "</del>");
|
||||
}
|
||||
|
||||
_formatQuote = () => {
|
||||
|
|
Loading…
Reference in a new issue