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 MarkdownParagraphConvertContextRemarks
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
| Name | Description |
|---|---|
| CompletedLineCount | Gets the number of lines of the block, once MarkdownParagraphConvertContext.Complete is called, or 0. |
| FirstLine | Gets the first line of the block, once MarkdownParagraphConvertContext.Complete is called. |
| LineCount | Gets the number of lines of the paragraph. |
| Options | Gets the options of the parser. |
| State | Gets the state of the extension for the document, which MarkdownSyntaxExtension.CreateState creates. |
CompletedLineCount
MarkdownParagraphConvertContext.csGets the number of lines of the block, once MarkdownParagraphConvertContext.Complete is called, or 0.
public readonly int CompletedLineCount { get; }Property value
FirstLine
MarkdownParagraphConvertContext.csGets the first line of the block, once MarkdownParagraphConvertContext.Complete is called.
public readonly int FirstLine { get; }Property value
LineCount
MarkdownParagraphConvertContext.csGets the state of the extension for the document, which MarkdownSyntaxExtension.CreateState creates.
public readonly object? State { get; }Property value
Methods
| Name | Description |
|---|---|
| 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.csReports 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.
Parameters
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.Completewas called.
AddMarker(int, int, int)
MarkdownParagraphConvertContext.csReports a marker of the block, which the HTML does not have by default.
Parameters
Exceptions
ArgumentOutOfRangeException- The range is empty, is not in its line, or starts before the end of the previous part.
InvalidOperationExceptionMarkdownParagraphConvertContext.Completewas called.
AddText(int, int, int)
MarkdownParagraphConvertContext.csReports text of the block, which the HTML has by default, escaped.
Parameters
Exceptions
ArgumentOutOfRangeException- The range is empty, is not in its line, or starts before the end of the previous part.
InvalidOperationExceptionMarkdownParagraphConvertContext.Completewas called.
Complete(int, int)
MarkdownParagraphConvertContext.csEnds the block, which has the lines from firstLine: the lines before stay a paragraph, and the lines after are offered to the converters again.
Parameters
Exceptions
ArgumentOutOfRangeException- The lines are not lines of the paragraph, or a part is not in them.
InvalidOperationException- No part is reported, or
MarkdownParagraphConvertContext.Completewas called.
GetLine(int)
MarkdownParagraphConvertContext.csGets a line of the paragraph, without its line ending, and without the markers of its containers.
public readonly ReadOnlySpan<char> GetLine(int index)Parameters
indexint
Returns
Exceptions
ArgumentOutOfRangeExceptionindexis negative, or not less thanMarkdownParagraphConvertContext.LineCount.
GetState(MarkdownSyntaxExtension)
MarkdownParagraphConvertContext.csGets 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
extensionMarkdownSyntaxExtension
Returns
Exceptions
ArgumentExceptionextensionis not inMarkdownParseOptions.SyntaxExtensions.ArgumentNullExceptionextensionisnull.