Cleanup
This commit is contained in:
+5
-12
@@ -1,5 +1,5 @@
|
||||
import type { LintEvent, WidgetContent } from "$sb/app_event.ts";
|
||||
import { events, language, space, system } from "$sb/syscalls.ts";
|
||||
import { events, language, space } from "$sb/syscalls.ts";
|
||||
import {
|
||||
findNodeOfType,
|
||||
parseTreeToAST,
|
||||
@@ -70,16 +70,11 @@ export async function widget(
|
||||
}
|
||||
}
|
||||
|
||||
return system.invokeFunction(
|
||||
"markdown.markdownContentWidget",
|
||||
resultMarkdown,
|
||||
pageName,
|
||||
);
|
||||
return {
|
||||
markdown: resultMarkdown,
|
||||
};
|
||||
} catch (e: any) {
|
||||
return system.invokeFunction(
|
||||
"markdown.markdownContentWidget",
|
||||
`**Error:** ${e.message}`,
|
||||
);
|
||||
return { markdown: `**Error:** ${e.message}` };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +162,5 @@ async function allQuerySources(): Promise<string[]> {
|
||||
const allObjectTypes: string[] = (await events.dispatchEvent("query_", {}))
|
||||
.flat();
|
||||
|
||||
// console.log("All object types", allObjectTypes);
|
||||
|
||||
return [...allSources, ...allObjectTypes];
|
||||
}
|
||||
|
||||
+4
-10
@@ -59,16 +59,10 @@ export async function widget(
|
||||
rendered = renderToText(parsedMarkdown);
|
||||
}
|
||||
|
||||
return system.invokeFunction(
|
||||
"markdown.markdownContentWidget",
|
||||
rendered,
|
||||
pageName,
|
||||
);
|
||||
return { markdown: rendered };
|
||||
} catch (e: any) {
|
||||
return system.invokeFunction(
|
||||
"markdown.markdownContentWidget",
|
||||
`**Error:** ${e.message}`,
|
||||
pageName,
|
||||
);
|
||||
return {
|
||||
markdown: `**Error:** ${e.message}`,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user