Is there any api method that can prevent document node rendering?

What I’m trying to do

I developed a simple plugin to show or hide meta yaml by css. There will be a bug The cursor gets stuck in the collapsed YAML zone due to hidden elements. Therefore, I want to prevent meta yaml regions from being generated when markdown rendering.

Things I have tried

I tried to use Replace decorations to hide meta yaml, but there will be many empty lines. So I would like to ask if there is an API that prevents nodes from rendering.

Here are my custom widget:

export class EmptyWidget extends WidgetType {
	toDOM(view: EditorView): HTMLElement {
		const div = document.createElement("span");
		div.innerText = "";
		return div;
	}
}

Replace the sample code new EmojiWidget() with new EmptyWidget().

This problem has been solved by controlling cursor jumps

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.