You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
first impl of inline formatting
This commit is contained in:
@@ -455,22 +455,26 @@ export default class BasicMessageEditor extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_formatBold = () => {
|
_wrapSelection(prefix, suffix = prefix) {
|
||||||
const {partCreator} = this.props.model;
|
const {partCreator} = this.props.model;
|
||||||
this._replaceSelection(range => {
|
this._replaceSelection(range => {
|
||||||
const parts = range.parts;
|
const parts = range.parts;
|
||||||
parts.splice(0, 0, partCreator.plain("**"));
|
parts.splice(0, 0, partCreator.plain(prefix));
|
||||||
parts.push(partCreator.plain("**"));
|
parts.push(partCreator.plain(suffix));
|
||||||
return parts;
|
return parts;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_formatItalic = () => {
|
_formatBold = () => {
|
||||||
|
this._wrapSelection("**");
|
||||||
|
}
|
||||||
|
|
||||||
|
_formatItalic = () => {
|
||||||
|
this._wrapSelection("*");
|
||||||
}
|
}
|
||||||
|
|
||||||
_formatStrikethrough = () => {
|
_formatStrikethrough = () => {
|
||||||
|
this._wrapSelection("<del>", "</del>");
|
||||||
}
|
}
|
||||||
|
|
||||||
_formatQuote = () => {
|
_formatQuote = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user