Skip to content

getCodeBlockMarkdownInfo

Gets the information about a code block in a Markdown section.

This is a pure read, safe to call while a code block renders. It locates the block in the text the user sees: the view data of an open markdown view of the source note when there is one, because an unsaved edit there is what the block was rendered from, and the file’s content otherwise. It never saves the note.

Import:

import { getCodeBlockMarkdownInfo } from '@mnaoumov/obsidian-lib/markdown-code-block-processor';

Signature:

function getCodeBlockMarkdownInfo(params: GetCodeBlockMarkdownInfoParams): Promise<CodeBlockMarkdownInformation | null>

Parameters:

Parameter Type Description
params GetCodeBlockMarkdownInfoParams The parameters for the function.

Returns: Promise<CodeBlockMarkdownInformation | null> — The information about the code block in the Markdown section.


Links to this page: