Fixes #539 linter support, now checking YAML formats
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user