MarkdownCodeFenceInfo
OfficeIMO.Markdown
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.
Returned or exposed by 6
- Property CodeBlock.FenceInfo
- Method MarkdownCodeFenceInfo.Parse
- Property MarkdownFencedBlockFactoryContext.FenceInfo
- Property MarkdownNativeCodeBlock.FenceInfo
- Property MarkdownNativeVisualBlock.FenceInfo
- Property SemanticFencedBlock.FenceInfo
Methods
public string? GetAttribute(params string[] aliases) #Reads the first parsed attribute value that matches any of the provided aliases.
Parameters
- aliases string[]
Returns
string?public bool HasClass(string className) #Determines whether the fence metadata contains the given CSS class.
Parameters
- className string
Returns
boolpublic static MarkdownCodeFenceInfo Parse(string? infoString) #Parses a fenced-code info string into its primary language token and additional metadata.
Parameters
- infoString string?
Returns
MarkdownCodeFenceInfopublic bool TryGetAttribute(string name, out string? value) #Reads a parsed attribute value by key.
Parameters
- name string
- value string?
Returns
boolpublic bool TryGetAttribute(out string? value, params string[] aliases) #Reads the first parsed attribute value that matches any of the provided aliases.
Parameters
- value string?
- aliases string[]
Returns
boolpublic bool TryGetBooleanAttribute(string name, out bool value) #Attempts to read a parsed boolean attribute value.
Parameters
- name string
- value bool
Returns
boolpublic 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
- aliases string[]
Returns
boolpublic bool TryGetInt32Attribute(string name, out int value) #Attempts to read a parsed 32-bit integer attribute value.
Parameters
- name string
- value int
Returns
boolpublic 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
- aliases string[]
Returns
boolInherited Methods
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.