Fixes #539 linter support, now checking YAML formats

This commit is contained in:
Zef Hemel
2023-11-21 16:24:20 +01:00
parent aa5bff548d
commit 2aed9e5685
9 changed files with 230 additions and 36 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ class AdmonitionIconWidget extends WidgetType {
toDOM(): HTMLElement {
const outerDiv = document.createElement("div");
outerDiv.classList.add("sb-admonition-icon");
outerDiv.addEventListener("click", (e) => {
outerDiv.addEventListener("click", () => {
this.editorView.dispatch({
selection: {
anchor: this.pos,
+11
View File
@@ -0,0 +1,11 @@
import { Diagnostic, linter } from "@codemirror/lint";
import type { Client } from "../client.ts";
export function plugLinter(client: Client) {
return linter(async (): Promise<Diagnostic[]> => {
const results = (await client.dispatchAppEvent("editor:lint", {
name: client.currentPage!,
})).flat();
return results;
});
}