Editor refactor: extract system stuff

This commit is contained in:
Zef Hemel
2023-07-14 13:44:30 +02:00
parent 87b0e7e352
commit b39a9b8e22
8 changed files with 240 additions and 190 deletions
+1 -2
View File
@@ -8,9 +8,8 @@ import { renderDirectives } from "./directives.ts";
import { extractFrontmatter } from "$sb/lib/frontmatter.ts";
import { PageMeta } from "../../web/types.ts";
export async function updateDirectivesOnPageCommand(arg: any) {
export async function updateDirectivesOnPageCommand() {
// If `arg` is a string, it's triggered automatically via an event, not explicitly via a command
const explicitCall = typeof arg !== "string";
const pageMeta = await space.getPageMeta(await editor.getCurrentPage());
const text = await editor.getText();
const tree = await markdown.parseMarkdown(text);