Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/editors/slate/markdown-to-slate/register.ts
6118 views
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Descendant } from "slate";
7
import { State, Token } from "./types";
8
9
type Handler = (opts: {
10
token: Token;
11
state: State;
12
cache?;
13
}) => Descendant[] | undefined;
14
15
export const handlers: Handler[] = [];
16
17
export function register(handler: Handler): void {
18
// console.log("register", handler);
19
handlers.push(handler);
20
}
21
22