1
0
silverbullet/plugos-silverbullet-syscall/markdown.ts

18 lines
476 B
TypeScript
Raw Normal View History

2022-04-03 16:12:16 +00:00
import {syscall} from "./syscall";
import type {MarkdownTree} from "../common/tree";
export async function parse(text: string): Promise<MarkdownTree> {
return syscall("markdown.parse", text);
}
export async function nodeAtPos(
mdTree: MarkdownTree,
pos: number
): Promise<MarkdownTree | null> {
2022-04-03 16:12:16 +00:00
return syscall("markdown.nodeAtPos", mdTree, pos);
}
export async function render(mdTree: MarkdownTree): Promise<string> {
return syscall("markdown.render", mdTree);
}