UNPKG

@uiw/react-md-editor

Version:

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

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