Keine Beschreibung

tabCommand.tsx 496B

12345678910111213141516
  1. import * as React from "react";
  2. import {Command} from "../types";
  3. import {onTab} from "../util/MarkdownUtil";
  4. import {getMarkdownStateFromDraftState, buildNewDraftState} from "../util/DraftUtil";
  5. export const tabCommand: Command = {
  6. buttonContentBuilder: () => null,
  7. buttonProps: null,
  8. execute: (state, reverse) => {
  9. let mdState = getMarkdownStateFromDraftState(state);
  10. mdState = onTab(mdState, reverse);
  11. return buildNewDraftState(state, mdState);
  12. },
  13. };