Exposing fetch to functions and initial work on Electron
This commit is contained in:
+10
-1
@@ -1,4 +1,4 @@
|
||||
import { renderToText, replaceNodesMatching } from "../../common/tree";
|
||||
import { findNodeOfType, renderToText, replaceNodesMatching } from "../../common/tree";
|
||||
import { parseMarkdown } from "plugos-silverbullet-syscall/markdown";
|
||||
|
||||
export function encodePageUrl(name: string): string {
|
||||
@@ -19,6 +19,15 @@ export async function cleanMarkdown(text: string): Promise<string> {
|
||||
if (n.type === "CommentBlock" || n.type === "Comment") {
|
||||
return null;
|
||||
}
|
||||
if (n.type === "FencedCode") {
|
||||
let codeInfoNode = findNodeOfType(n, "CodeInfo");
|
||||
if (!codeInfoNode) {
|
||||
return;
|
||||
}
|
||||
if (codeInfoNode.children![0].text === "meta") {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
return renderToText(mdTree);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user