silverbullet/packages/common/syscalls/markdown.ts

13 lines
387 B
TypeScript
Raw Normal View History

2022-10-04 22:33:29 +08:00
import { SysCallMapping } from "../../plugos/system.ts";
import { parse } from "../parse_tree.ts";
2022-10-06 17:31:49 +08:00
import { Language } from "../../../dep_common.ts";
2022-10-04 22:33:29 +08:00
import type { ParseTree } from "../tree.ts";
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-10-04 22:33:29 +08:00
"markdown.parseMarkdown": (_ctx, text: string): ParseTree => {
2022-04-12 02:34:09 +08:00
return parse(lang, text);
2022-04-04 17:51:41 +08:00
},
};
2022-04-04 00:12:16 +08:00
}