Expand description
This module contains the parser for converting tokenized Markdown lines into structured Markdown elements.
It provides functions to parse block-level elements like headings, lists, and code blocks, as well as inline elements like links, images, and emphasis.
FunctionsΒ§
- attach_
to_ πprevious_ block - Attaches the current line to the previous block, optionally adding a separator token.
- flatten_
inline π - Flattens a vector of inline Markdown elements into a single string.
- group_
asterisked_ πlines - Groups lines that start with asterisks into blocks.
- group_
dashed_ πlines - Groups dashed lines into blocks based on the previous blockβs content.
- group_
lines_ to_ blocks - Groups adjacent tokenized lines into groups (blocks) for further parsing.
- group_
lines_ πwith_ leading_ whitespace - Groups lines with leading whitespace into blocks based on the previous blockβs content.
- group_
ordered_ πlist - Groups ordered list lines into a block by appending the line to the previous block if it is part of the same list.
- group_
setext_ πheading_ one - Groups Setext heading 1 lines into a block by prepending the previous block with β# β.
- group_
tabbed_ πlines - Groups tabbed lines into blocks based on the previous blockβs content.
- group_
table_ πrows - Groups lines beginning with β|β denoting Markdown tables.
- group_
text_ πlines - Groups text lines into blocks based on the previous blockβs content.
- make_
image π - Helper function used in
parse_link_type
to circumvent Rustβs limitation on closure recursion - make_
link π - Helper function used in
parse_link_type
to circumvent Rustβs limitation on closure recursion - parse_
block π - Parses a single line of tokens into a block-level Markdown element.
- parse_
blockquote π - Parses a blockquote from a vector of tokens into an
MdBlockElement::BlockQuote
. - parse_
blocks - Parses a vector of tokenized markdown lines into a vector of block-level Markdown elements.
- parse_
code_ πspan - Parses a code span starting from the current position of the cursor.
- parse_
codeblock π - Parses a vector of tokens representing a code block into an
MdBlockElement::CodeBlock
. - parse_
heading π - Parses a vector of tokens representing a heading into an
MdBlockElement::Header
. - parse_
indented_ πcodeblock - Parses an indented code block from a vector of tokens.
- parse_
inline - Parses a vector of tokens into a vector of inline Markdown elements (i.e. links, images, bold/italics, etc.).
- parse_
link_ πtype - Parses a link type (either a link or an image) from the current position of the cursor.
- parse_
list π - Generic list parser used to reduce code duplication between ordered and unordered lists.
- parse_
ordered_ πlist - Parses a vector of tokens representing an ordered list into an
MdBlockElement::OrderedList
. - parse_
raw_ πhtml - Parses raw HTML tags from a vector of tokens into an
MdBlockElement::RawHtml
. - parse_
table - Parses GitHub-style tables from the input vector of tokens.
- parse_
unordered_ πlist - Parses a vector of tokens representing an unordered list into an
MdBlockElement::UnorderedList
. - resolve_
emphasis π - Wrapper function to start the call chain for
resolve_emphasis_recursive
if there is more than one delimiter in the stack. - resolve_
emphasis_ πrecursive - Recursively parses (resolves) emphasis in a vector of inline Markdown elements.
- split_
row π - Helper function to split a row of tokens into individual cells.