The block level markdown parser: it splits the document into the block elements and then delegates the text of each block to the InlineParser or the TableRenderer.
BlockParser
00 Remarks
The block elements that are supported here:
- the
#atx header - the
``` fenced code block, of which the content is never parsed - the pipe table
- the
>block quote - the
-/+/*/1.list item - the
---/***/___horizontal rule - the normal paragraph
Note that the setext header(the ===/--- underlined header) is not supported, as the --- underline is ambiguous with the horizontal rule, and the horizontal rule always wins here.
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| Parse | 1 | parse the whole markdown document |
| ParseFencedCode | 1 | the fenced code block is emitted as the plain text, its content is never parsed by the inline parser. |
| AppendSpans | 1 | appends the inline spans of one line and then terminates the line |
| IsHorizontalRule | 1 | the ---/*/_ horizontal rule line |
| IsTableStart | 1 | a table is started by a pipe line that is followed by the --|--- delimiter row, this rule is much more reliable than just testing the leading pipe char of the line. |
| HeaderLevel | 1 | gets the atx header level of the given line, or ZERO if it is not a header |
| StripListItem | 1 | strips the -/+/*/1. list marker from the line |
| StripQuoteMarker | 1 | strips the leading > marker and its following space |
03 Fields
| Name | Overloads | Summary |
|---|---|---|
| LF | 1 | the line feed of the rendered result, the cr-lf pair is never used in this module to keep the output consistent on all platforms. |
04 Members
String())parse the whole markdown document
| Name | Type | Description |
|---|---|---|
lines | String() | the document lines, without the line feed char |
String(), Int32)the fenced code block is emitted as the plain text, its content is never parsed by the inline parser.
| Name | Type | Description |
|---|---|---|
lines | String() | - |
from | Int32 | the index of the opening fence line |
the index of the next line after the closing fence
appends the inline spans of one line and then terminates the line
| Name | Type | Description |
|---|---|---|
spans | List(Of TextSpan) | - |
fallbackStyle | ConsoleFormat | the style of the line feed char, which is required when the line has no content at all. |
String)the ---/***/___ horizontal rule line
| Name | Type | Description |
|---|---|---|
line | String | - |
String(), Int32)a table is started by a pipe line that is followed by the --|--- delimiter row, this rule is much more reliable than just testing the leading pipe char of the line.
| Name | Type | Description |
|---|---|---|
lines | String() | - |
i | Int32 | - |
String)gets the atx header level of the given line, or ZERO if it is not a header
| Name | Type | Description |
|---|---|---|
line | String | - |
a value between 1 and 6
String, String)strips the -/+/*/1. list marker from the line
| Name | Type | Description |
|---|---|---|
line | String | - |
marker | String | the stripped marker text |
the content of the list item, or a null reference if the given line is not a list item at all.
String)strips the leading > marker and its following space
| Name | Type | Description |
|---|---|---|
line | String | - |
the line feed of the rendered result, the cr-lf pair is never used in this module to keep the output consistent on all platforms.