1
0
silverbullet/packages/silverbullet-common/syscalls/markdown.ts

13 lines
375 B
TypeScript
Raw Normal View History

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