Module parse

Source

Structs§

Context 🔒
Parsing context

Enums§

BreakRule 🔒
Whether two types should or shouldn’t have a paragraph break between them
ParseOpt 🔒
Flags to simple parser function
Prev 🔒
Character class preceding this one

Constants§

ANC_E 🔒
Short aliases that we can use in match patterns. If an end pattern is not included, this type may be variable
ANC_S 🔒
BRK 🔒
CBK 🔒
CIL 🔒
CMT_E 🔒
CMT_S 🔒
EMP_A 🔒
EMP_U 🔒
HDG 🔒
LNK_CHARS 🔒
LNK_E 🔒
LNK_S 🔒
REPLACEMENTS 🔒
Pattern replacements
STG_A 🔒
STG_U 🔒
STK 🔒

Functions§

entrypoint 🔒
Parse a buffer
expand_plaintext 🔒
Perform transformations to text. This splits paragraphs, replaces patterns, and corrects newlines.
get_indented_section 🔒
is_break_ty 🔒
Types that indicate some form of break
match_reflink 🔒
Turn reflinks (links with reference IDs) into normal standalone links using listed link definitions
normalize 🔒
Take a parsed stream and fix the little things
ord_list_start 🔒
Verify a valid ordered list start (e.g. 1.) and parse it. Returns the parsed number and offset of character after the dot.
parse_any_link 🔒
Parse links. can_be_def indicates that a link definition is possible (top level, located at the start of a line)
parse_codeblock 🔒
Parse a codeblock. Accounts for >3 backticks and language specification
parse_codeinline 🔒
Parse backtick-wrapped inline code. Accounts for >1 backtick sets
parse_heading 🔒
parse_ordered_li 🔒
Numbered list
parse_recursive 🔒
Parse a buffer with specified context
parse_simple_pat 🔒
The simplest kind of patterns: data within start and end patterns
parse_to_newline 🔒
Return (match, residual) to end of line. The EOL is returned with the residual.
parse_unordered_li 🔒
Bulleted list
parse_with_end_pat 🔒
Find and consume an end pattern, return (match, residual)
should_break 🔒
Blocks that automatically handle their own text wrapping
trim_ascii_start 🔒
If there is more than one whitespace char at start, trim the extras
trim_extra_ws 🔒
If there is more than one whitespace char at start or end, trim the extras
unordered_list_start 🔒

Type Aliases§

ParseResult 🔒
Output of a parse function
Parsed 🔒
(extracted, remaining)