uiwjs / react-markdown-editor

A markdown editor with preview, implemented with React.js and TypeScript.
https://uiwjs.github.io/react-markdown-editor
MIT License
337 stars 34 forks source link

Support for Shortcut & Tooltip #225

Open Udhayarajan opened 3 months ago

Udhayarajan commented 3 months ago

Ability to use shortcuts for actions like quoting with ctrl+q and bolding with ctrl+B. Also, adding tooltips for the editor toolbar icons on hover would greatly improve user experience.

jaywcjlove commented 3 months ago
const CustomKeymap = keymap.of([
  {
    key: "Ctrl-S",
    run: () => {
      console.log("Ctrl-S pressed");
      return true;
    }
  },
  {
    key: "Ctrl-B",
    run: () => {
      console.log("Ctrl-B pressed");
      return true;
    }
  },
]);

const Dome = () => {
  return (
    <MarkdownEditor
      value={mdStr}
      extensions=[CustomKeymap]
    />
  )
};

@Udhayarajan It seems this feature is not easy to implement.