MarkdownParagraphConvertContext Struct

  • Obsolete: Types with embedded references are not supported in this version of your compiler.

The lines of a paragraph that a MarkdownParagraphExtension reads, and where it reports the parts of its block: markers, text and inlines, each on one line. The positions are relative to the start of their line.

[Obsolete("Types with embedded references are not supported in this version of your compiler.", true)]
public ref struct MarkdownParagraphConvertContext

Remarks

The parts are reported in the order of the text, without overlapping. The characters of the lines of the block that no part covers are text, except the whitespace around the parts. The node of the block has every character of its lines, so the tree still reproduces the document.

Properties

NameDescription
CompletedLineCountGets the number of lines of the block, once MarkdownParagraphConvertContext.Complete is called, or 0.
FirstLineGets the first line of the block, once MarkdownParagraphConvertContext.Complete is called.
LineCountGets the number of lines of the paragraph.
OptionsGets the options of the parser.
StateGets the state of the extension for the document, which MarkdownSyntaxExtension.CreateState creates.

Gets the number of lines of the block, once MarkdownParagraphConvertContext.Complete is called, or 0.

public readonly int CompletedLineCount { get; }

Property value

int

Gets the first line of the block, once MarkdownParagraphConvertContext.Complete is called.

public readonly int FirstLine { get; }

Property value

int

Gets the number of lines of the paragraph.

public readonly int LineCount { get; }

Property value

int

Gets the options of the parser.

public readonly MarkdownParseOptions Options { get; }

Property value

MarkdownParseOptions

Gets the state of the extension for the document, which MarkdownSyntaxExtension.CreateState creates.

public readonly object? State { get; }

Property value

object?

Methods

NameDescription
AddInlines(int, int, int)Reports content that the parser reads as inlines, such as emphasis and links. It cannot be the first part of the block: report a marker or text first.
AddMarker(int, int, int)Reports a marker of the block, which the HTML does not have by default.
AddText(int, int, int)Reports text of the block, which the HTML has by default, escaped.
Complete(int, int)Ends the block, which has the lines from firstLine: the lines before stay a paragraph, and the lines after are offered to the converters again.
GetLine(int)Gets a line of the paragraph, without its line ending, and without the markers of its containers.
GetState(MarkdownSyntaxExtension)Gets the state of another extension of the options for the document, such as the block extension whose definitions an inline extension reads.

AddInlines(int, int, int)

MarkdownParagraphConvertContext.cs

Reports content that the parser reads as inlines, such as emphasis and links. It cannot be the first part of the block: report a marker or text first.

public void AddInlines(int line, int start, int length)

Parameters

line int
start int
length int

Exceptions

ArgumentOutOfRangeException
The range is empty, is not in its line, or starts before the end of the previous part.
InvalidOperationException
No marker or text is reported before, or MarkdownParagraphConvertContext.Complete was called.

AddMarker(int, int, int)

MarkdownParagraphConvertContext.cs

Reports a marker of the block, which the HTML does not have by default.

public void AddMarker(int line, int start, int length)

Parameters

line int
start int
length int

Exceptions

ArgumentOutOfRangeException
The range is empty, is not in its line, or starts before the end of the previous part.
InvalidOperationException
MarkdownParagraphConvertContext.Complete was called.

Reports text of the block, which the HTML has by default, escaped.

public void AddText(int line, int start, int length)

Parameters

line int
start int
length int

Exceptions

ArgumentOutOfRangeException
The range is empty, is not in its line, or starts before the end of the previous part.
InvalidOperationException
MarkdownParagraphConvertContext.Complete was called.

Ends the block, which has the lines from firstLine: the lines before stay a paragraph, and the lines after are offered to the converters again.

public void Complete(int firstLine, int lineCount)

Parameters

firstLine int
lineCount int

Exceptions

ArgumentOutOfRangeException
The lines are not lines of the paragraph, or a part is not in them.
InvalidOperationException
No part is reported, or MarkdownParagraphConvertContext.Complete was called.

Gets a line of the paragraph, without its line ending, and without the markers of its containers.

public readonly ReadOnlySpan<char> GetLine(int index)

Parameters

index int

Returns

ReadOnlySpan<char>

Exceptions

ArgumentOutOfRangeException
index is negative, or not less than MarkdownParagraphConvertContext.LineCount.

GetState(MarkdownSyntaxExtension)

MarkdownParagraphConvertContext.cs

Gets the state of another extension of the options for the document, such as the block extension whose definitions an inline extension reads.

public readonly object? GetState(MarkdownSyntaxExtension extension)

Parameters

extension MarkdownSyntaxExtension

Returns

object?

Exceptions

ArgumentException
extension is not in MarkdownParseOptions.SyntaxExtensions.
ArgumentNullException
extension is null.