UNPKG

@uiw/react-md-editor

Version:

A markdown editor with preview, implemented with React.js and TypeScript.

28 lines 756 B
import * as React from 'react'; import { insertAtLineStart } from '../utils/InsertTextAtPosition'; import { jsx as _jsx } from "react/jsx-runtime"; export var title5 = { name: 'title5', keyCommand: 'title5', shortcuts: 'ctrlcmd+5', value: 'title5', buttonProps: { 'aria-label': 'Insert title5 (ctrl + 5)', title: 'Insert title5 (ctrl + 5)' }, icon: /*#__PURE__*/_jsx("div", { style: { fontSize: 12, textAlign: 'left' }, children: "Title 5" }), execute: (state, api) => { if (state.selection.start === 0 || /\n$/.test(state.text)) { api.replaceSelection('##### '); } else { insertAtLineStart('##### ', state.selection.start, api.textArea); } } }; //# sourceMappingURL=title5.js.map