You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
easy-markdown-editor/src/toolbar/buttons/toggle-code.ts

14 lines
421 B
TypeScript

import { EasyMDE } from '../../easymde';
import { toggleBlock } from '../../utils/toggle-block';
import { IToolbarButtonOptions } from '../default-toolbar';
export const toggleCode = (editor: EasyMDE) =>
toggleBlock(editor.codemirror, editor.options.blockStyles.code);
export const toggleCodeButton: IToolbarButtonOptions = {
action: toggleCode,
icon: 'fas fa-code',
name: 'code',
title: 'Code',
};