Exposing fetch to functions and initial work on Electron

This commit is contained in:
Zef Hemel
2022-04-21 11:46:33 +02:00
parent dbdfc9d631
commit 32f3501773
33 changed files with 810 additions and 571 deletions
+10 -1
View File
@@ -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);
}