Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

CodeBlock

OfficeIMO.Markdown

Namespace
OfficeIMO.Markdown
Assembly
OfficeIMO.Markdown
Source revision
0eef6a5756b9 with working tree changes
Implements
IMarkdownBlock ICaptionable ISyntaxMarkdownBlock IHtmlAppendableMarkdownBlock
Modifiers
sealed

Fenced code block with optional caption. Fence length adapts to backticks inside the content.

Inheritance

Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 1

Accepted by parameters 2

Constructors

public CodeBlock(string language, string content) #

Create a code block with an optional fenced-code info string.

Parameters

language string required
content string required

Properties

public string Language { get; } #

Parsed primary fence language token (for example csharp or bash).

public string InfoString { get; } #

Full fenced-code info string as it appeared after the opening fence marker.

public MarkdownCodeFenceInfo FenceInfo { get; } #

Structured fenced-code info metadata.

public string Content { get; } #

Code contents, excluding one terminating newline when parsed from a code block.

public string? Caption { get; set; } #

Optional caption shown under the block.

public MarkdownSourceSpan? OpeningFenceSourceSpan { get; internal set; } #

Source span for the opening fence token when parsed from a fenced source block.

public MarkdownSourceSpan? InfoStringSourceSpan { get; internal set; } #

Source span for the fenced-code info string when parsed from a fenced source block.

public MarkdownSourceSpan? ContentSourceSpan { get; internal set; } #

Source span for the code payload when source-backed.

public MarkdownSourceSpan? ClosingFenceSourceSpan { get; internal set; } #

Source span for the closing fence token when parsed from a closed fenced source block.