silverbullet/packages/common/syscalls/markdown.ts

13 lines
377 B
TypeScript
Raw Normal View History

2022-04-25 16:33:38 +08:00
import { SysCallMapping } from "@plugos/plugos/system";
2022-04-12 02:34:09 +08:00
import { parse } from "../parse_tree";
import { Language } from "@codemirror/language";
import type { ParseTree } from "../tree";
2022-04-04 00:12:16 +08:00
2022-04-12 02:34:09 +08:00
export function markdownSyscalls(lang: Language): SysCallMapping {
2022-04-04 17:51:41 +08:00
return {
2022-04-12 02:34:09 +08:00
"markdown.parseMarkdown": (ctx, text: string): ParseTree => {
return parse(lang, text);
2022-04-04 17:51:41 +08:00
},
};
2022-04-04 00:12:16 +08:00
}