@uiw/react-md-editor
Version:
A markdown editor with preview, implemented with React.js and TypeScript.
27 lines • 710 B
JavaScript
import * as React from 'react';
import { insertAtLineStart } from '../utils/InsertTextAtPosition';
import { jsx as _jsx } from "react/jsx-runtime";
export var title2 = {
name: 'title2',
keyCommand: 'title2',
shortcuts: 'ctrlcmd+2',
buttonProps: {
'aria-label': 'Insert title2',
title: 'Insert title 2'
},
icon: /*#__PURE__*/_jsx("div", {
style: {
fontSize: 16,
textAlign: 'left'
},
children: "Title 2"
}),
execute: (state, api) => {
if (state.selection.start === 0 || /\n$/.test(state.text)) {
api.replaceSelection('## ');
} else {
insertAtLineStart('## ', state.selection.start, api.textArea);
}
}
};
//# sourceMappingURL=title2.js.map