Skip to content

codemirror/markdown-editor-views

Reaches the CodeMirror EditorView of every open Markdown view, in every window.

A Markdown view in Reading mode is included on purpose: it keeps its source editor alive while hidden, and a reconfigure or state change that skipped it would leave that editor stale when the user switches back.

Only editors that live in a workspace leaf are reached. An editor Obsidian builds elsewhere (a canvas card, an editable embed, a hover popover) has no leaf, so it picks up registered extensions when it is created rather than through these helpers.

Function Description
dispatchToAllMarkdownEditorViews Dispatches the given transaction specs to the editor of every open Markdown view, in every window. Each editor receives its own transaction built from the same specs, so a spec must not carry positions that only make sense in one document. Annotations and state effects (such as a compartment reconfigure) are the intended payload.
getAllMarkdownEditorViews Gets the editor of every open Markdown view, in every window, Reading mode included.