Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

MarkdownCodeFenceInfo

OfficeIMO.Markdown

Namespace
OfficeIMO.Markdown
Assembly
OfficeIMO.Markdown
Source revision
0eef6a5756b9 with working tree changes
Modifiers
sealed

Parsed fenced-code info string preserving the original raw value while exposing the primary language token.

Inheritance

  • object
  • MarkdownCodeFenceInfo

Usage

Explore 6 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.

Methods

public string? GetAttribute(params string[] aliases) #

Reads the first parsed attribute value that matches any of the provided aliases.

Parameters

aliases string[] required

Returns

string?
public bool HasClass(string className) #

Determines whether the fence metadata contains the given CSS class.

Parameters

className string required

Returns

bool
public static MarkdownCodeFenceInfo Parse(string? infoString) #

Parses a fenced-code info string into its primary language token and additional metadata.

Parameters

infoString string? required
TryGetAttribute 2 overloads
public bool TryGetAttribute(string name, out string? value) #

Reads a parsed attribute value by key.

Parameters

name string required
value string? required

Returns

bool
public bool TryGetAttribute(out string? value, params string[] aliases) #

Reads the first parsed attribute value that matches any of the provided aliases.

Parameters

value string? required
aliases string[] required

Returns

bool
TryGetBooleanAttribute 2 overloads
public bool TryGetBooleanAttribute(string name, out bool value) #

Attempts to read a parsed boolean attribute value.

Parameters

name string required
value bool required

Returns

bool
public bool TryGetBooleanAttribute(out bool value, params string[] aliases) #

Attempts to read a parsed boolean attribute value from any of the provided aliases.

Parameters

value bool required
aliases string[] required

Returns

bool
TryGetInt32Attribute 2 overloads
public bool TryGetInt32Attribute(string name, out int value) #

Attempts to read a parsed 32-bit integer attribute value.

Parameters

name string required
value int required

Returns

bool
public bool TryGetInt32Attribute(out int value, params string[] aliases) #

Attempts to read a parsed 32-bit integer attribute value from any of the provided aliases.

Parameters

value int required
aliases string[] required

Returns

bool

Properties

public string InfoString { get; } #

Full normalized fence info string exactly as it should round-trip after the opening fence marker.

public string Language { get; } #

Primary fence language token parsed from the info string.

public string AdditionalInfo { get; } #

Remaining fence metadata after the primary language token, preserved as raw trimmed text.

public string? ElementId { get; } #

Optional element id parsed from #id shorthand or id=... metadata.

public IReadOnlyList<string> Classes { get; } #

Optional CSS classes parsed from .class shorthand or class=... metadata.

public IReadOnlyDictionary<string, string?> Attributes { get; } #

Parsed attribute-style metadata from the additional info string. Recognizes key=value, key="value with spaces", and standalone flags.

public MarkdownAttributeSet GenericAttributes { get; } #

Markdig-style generic attributes parsed from explicit {...} fence-info attribute blocks only. Other fence options remain available through MarkdownCodeFenceInfo.Attributes for host renderers.

public bool HasExplicitAttributes { get; } #

True when the info string contains explicit attribute syntax such as {...}, #id, or .class. Plain key/value fence options remain available through MarkdownCodeFenceInfo.Attributes for host features but are not projected as generic HTML attributes by ordinary code blocks.

public string? Title { get; } #

Common convenience title resolved from title or caption attributes when present.