import * as React from 'react'; import { ICommand, TextState, TextApi } from './'; export const title3: ICommand = { name: 'title3', keyCommand: 'title3', shortcuts: 'ctrlcmd+3', buttonProps: { 'aria-label': 'Insert title3', title: 'Insert title 3' }, icon:
Title 3
, execute: (state: TextState, api: TextApi) => { let modifyText = `### ${state.selectedText}\n`; if (!state.selectedText) { modifyText = `### `; } api.replaceSelection(modifyText); }, };