Rewrote all plugs using MarkdownTree
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
import {SysCallMapping} from "../../plugos/system";
|
||||
import {MarkdownTree, nodeAtPos, parse, render} from "../tree";
|
||||
import {MarkdownTree, parse} from "../tree";
|
||||
|
||||
export function markdownSyscalls(): SysCallMapping {
|
||||
return {
|
||||
"markdown.parse": (ctx, text: string): MarkdownTree => {
|
||||
return parse(text);
|
||||
},
|
||||
"markdown.nodeAtPos": (ctx, mdTree: MarkdownTree, pos: number): MarkdownTree | null => {
|
||||
return nodeAtPos(mdTree, pos);
|
||||
},
|
||||
"markdown.render": (ctx, mdTree: MarkdownTree): string => {
|
||||
return render(mdTree);
|
||||
},
|
||||
};
|
||||
return {
|
||||
"markdown.parseMarkdown": (ctx, text: string): MarkdownTree => {
|
||||
return parse(text);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user