SilverBullet pivot to become an offline-first PWA (#403)
This commit is contained in:
@@ -2,32 +2,31 @@ import buildMarkdown from "../../common/markdown_parser/parser.ts";
|
||||
import { parse } from "../../common/markdown_parser/parse_tree.ts";
|
||||
import { System } from "../../plugos/system.ts";
|
||||
|
||||
import corePlug from "../../dist_bundle/_plug/core.plug.json" assert {
|
||||
type: "json",
|
||||
};
|
||||
import tasksPlug from "../../dist_bundle/_plug/tasks.plug.json" assert {
|
||||
type: "json",
|
||||
};
|
||||
import { createSandbox } from "../../plugos/environments/deno_sandbox.ts";
|
||||
import { loadMarkdownExtensions } from "../../common/markdown_parser/markdown_ext.ts";
|
||||
import { renderMarkdownToHtml } from "./markdown_render.ts";
|
||||
import { assertEquals } from "../../test_deps.ts";
|
||||
import { urlToPathname } from "../../plugos/util.ts";
|
||||
|
||||
Deno.test("Markdown render", async () => {
|
||||
const system = new System<any>("server");
|
||||
await system.load(corePlug, createSandbox);
|
||||
await system.load(tasksPlug, createSandbox);
|
||||
await system.load(
|
||||
new URL("../../dist_plug_bundle/_plug/core.plug.js", import.meta.url),
|
||||
createSandbox,
|
||||
);
|
||||
await system.load(
|
||||
new URL("../../dist_plug_bundle/_plug/tasks.plug.js", import.meta.url),
|
||||
createSandbox,
|
||||
);
|
||||
const lang = buildMarkdown(loadMarkdownExtensions(system));
|
||||
const testFile = Deno.readTextFileSync(
|
||||
urlToPathname(new URL("test/example.md", import.meta.url)),
|
||||
new URL("test/example.md", import.meta.url).pathname,
|
||||
);
|
||||
const tree = parse(lang, testFile);
|
||||
renderMarkdownToHtml(tree, {
|
||||
await renderMarkdownToHtml(tree, {
|
||||
failOnUnknown: true,
|
||||
renderFrontMatter: true,
|
||||
});
|
||||
// console.log("HTML", html);
|
||||
await system.unloadAll();
|
||||
});
|
||||
|
||||
Deno.test("Smart hard break test", async () => {
|
||||
|
||||
Reference in New Issue
Block a user