Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
CodeService.js 590 B
import Service from "../../Service";
import { toggleMark } from "prosemirror-commands";
import { codeMark } from "wax-prosemirror-schema";
import Code from "./Code";

class CodeService extends Service {
  boot() {
    const shortCuts = this.container.get("ShortCuts");
    shortCuts.addShortCut({ "Mod-`": toggleMark(this.schema.marks.code) });
  }

  register() {
    this.container.bind("Code").to(Code);
    const createMark = this.container.get("CreateMark");
    createMark(
      {
        code: codeMark
      },
      { toWaxSchema: true }
    );
  }
}

export default CodeService;