mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
first impl of inline formatting
This commit is contained in:
parent
e7db660820
commit
d4c7992f5a
@ -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 New Issue
Block a user