You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
add support for inline/block code formatting
This commit is contained in:
@@ -24,6 +24,7 @@ import {setCaretPosition} from '../../../editor/caret';
|
||||
import {
|
||||
replaceRangeAndExpandSelection,
|
||||
formatRangeAsQuote,
|
||||
formatRangeAsCode,
|
||||
formatInline,
|
||||
} from '../../../editor/operations';
|
||||
import {getCaretOffsetAndText, getRangeForSelection} from '../../../editor/dom';
|
||||
@@ -457,8 +458,12 @@ export default class BasicMessageEditor extends React.Component {
|
||||
formatRangeAsQuote(range);
|
||||
}
|
||||
|
||||
_formatCodeBlock = () => {
|
||||
|
||||
_formatCode = () => {
|
||||
const range = getRangeForSelection(
|
||||
this._editorRef,
|
||||
this.props.model,
|
||||
document.getSelection());
|
||||
formatRangeAsCode(range);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user