Linked mentions improvements and other fixes

This commit is contained in:
Zef Hemel
2023-10-09 20:39:03 +02:00
parent ae3e5f375e
commit 17ba536801
9 changed files with 97 additions and 36 deletions
+7 -1
View File
@@ -19,7 +19,13 @@ const directiveUpdateQueueName = "directiveUpdateQueue";
export async function updateDirectivesOnPageCommand() {
// If `arg` is a string, it's triggered automatically via an event, not explicitly via a command
const currentPage = await editor.getCurrentPage();
const pageMeta = await space.getPageMeta(currentPage);
let pageMeta: PageMeta | undefined;
try {
pageMeta = await space.getPageMeta(currentPage);
} catch {
console.info("Page not found, not updating directives");
return;
}
const text = await editor.getText();
const tree = await markdown.parseMarkdown(text);
const metaData = await extractFrontmatter(tree, ["$disableDirectives"]);