Exception thrown when parsing a text markup document or fragment fails.
Reader implementation that keeps the current nest level in case of recursive parsing of block-level elements.
Provides additional combinator methods to parsers via implicit conversion.
API for specifying further constraints on the parsers provided by this base trait.
Consumes any kind of input, always succeeds.
Consumes any kind of input, always succeeds.
This parser would consume the entire input unless a max
constraint
is specified.
Consumes any number of consecutive characters that are not one of the specified characters.
Consumes any number of consecutive characters that are not one of the specified characters. Always succeeds unless a minimum number of required matches is specified.
Consumes any number of consecutive characters that are in one of the specified character ranges.
Consumes any number of consecutive characters that are in one of the specified character ranges. Always succeeds unless a minimum number of required matches is specified.
Consumes any number of consecutive occurrences of the specified characters.
Consumes any number of consecutive occurrences of the specified characters. Always succeeds unless a minimum number of required matches is specified.
Consumes any number of characters for which the specified parser fails on the corresponding offset.
Consumes any number of characters for which the specified parser fails on the corresponding offset.
This parser fails if the end of input is reached without the specified parser ever succeeding or
if the parser causes an Error result instead of a plain Failure or Success.
Further constraints like minimum or maximum number of required matching characters can be specified
through the API of the returned TextParser
instance.
Consumes any number of consecutive characters that are not one of the specified characters.
Consumes any number of consecutive characters that are not one of the specified characters.
This parser is identical to the anyBut
parser except for two differences: this parser fails
if it reaches the end of the input without seeing any of the specified
characters and it also consumes this final character, without adding it
to the result. This parser is usually used when a construct like a span
enclosed between two characters needs to be parsed.
Consumes any number of consecutive characters which satisfy the specified predicate.
Consumes any number of consecutive characters which satisfy the specified predicate. Always succeeds unless a minimum number of required matches is specified.
Succeeds at the start of the input.
Succeeds at the start of the input.
Parses an ATX header, a line that starts with 1 to 6 '#'
characters,
with the number of hash characters corresponding to the level of the header.
Parses an ATX header, a line that starts with 1 to 6 '#'
characters,
with the number of hash characters corresponding to the level of the header.
Markdown also allows to decorate the line with trailing '#'
characters which
this parser will remove.
Parses a blank line from the current input offset (which may not be at the start of the line).
Parses a blank line from the current input offset (which may not be at the start of the line). Fails for lines that contain any non-whitespace character. Does always produce an empty string as the result, discarding any whitespace characters found in the line.
Since it also succeeds at the end of the input
it should never be used in the form of (blankLine *)
or (blankLine +)
. Use
the blankLines
parser instead in these cases.
Parses one or more blanklines, producing a list of empty strings corresponding to the number of blank lines consumed.
Parses one or more blanklines, producing a list of empty strings corresponding to the number of blank lines consumed.
Parses a full block based on the specified helper parsers.
Parses a full block based on the specified helper parsers.
parser that recognizes the start of the first line of this block
parser that recognizes the start of subsequent lines that still belong to the same block
parser that recognizes whether a line after one or more blank lines still belongs to the same block
Builds a parser for a list of blocks based on the parser for a single block.
Builds a parser for a list of blocks based on the parser for a single block.
Parses a bullet list, called "unordered list" in the Markdown syntax description.
Parses the start of a bullet list item.
Implicit conversion that allows to pass a single
character to the range-based anyIn
parser.
Implicit conversion that allows to pass a single
character to the range-based anyIn
parser.
Parses an enumerated list, called "ordered list" in the Markdown syntax description.
Parses the start of an enumerated list item.
Succeeds at the end of the input.
Succeeds at the end of the input.
Succeeds at the end of a line, including the end of the input.
Succeeds at the end of a line, including the end of the input. Produces an empty string as a result and consumes any new line characters.
Parses a full block based on the specified helper parsers, expecting an indentation for all lines except the first.
Parses a full block based on the specified helper parsers, expecting an indentation for all lines except the first. The indentation may vary between the parts of the indented block, so that this parser only cuts off the minimum indentation shared by all lines, but each line must have at least the specified minimum indentation.
the minimum indentation that each line in this block must have
parser that recognizes the start of subsequent lines that still belong to the same block
indicates whether parsing should end on the first blank line
indicates whether the first line is expected to be indented, too
the maximum indentation that will get dropped from the start of each line of the result
a parser that produces an instance of IndentedBlock
Parses up to 3 space characters.
Parses up to 3 space characters. In Markdown an indentation of up to 3 spaces is optional and does not have any influence on the parsing logic.
Merges the specified list of lines into a single string, while looking for lines ending with double spaces which stand for a hard line break in Markdown.
Parses a list based on the specified helper parsers.
Parses a list based on the specified helper parsers.
parser that recognizes the start of a list item, result will be discarded
function that produces a block element for the document tree
function that produces a new list item element based on position and content arguments
Parses a single list item.
Parses a single list item.
parser that recognizes the start of a list item, result will be discarded
Parses a literal block, text indented by a tab or 4 spaces.
Applies the specified parser at the specified offset behind the current position.
Applies the specified parser at the specified offset behind the current position. Never consumes any input.
The maximum level of block nesting.
The maximum level of block nesting. Some block types like lists and blockquotes contain nested blocks. To protect against malicious input or accidentally broken markup, the level of nesting is restricted.
Parses a single Markdown block.
Parses a single Markdown block. In contrast to the generic block parser of the super-trait this method also consumes and ignores up to three optional space characters at the start of each line.
parser that recognizes the start of the first line of this block
parser that recognizes the start of subsequent lines that still belong to the same block
parser that recognizes whether a line after one or more blank lines still belongs to the same block
Returns the current nest level from the specified input or 0 if it cannot be determined.
Returns the current nest level from the specified input or 0 if it cannot be determined.
The nest level is usually only used to prevent endless recursion of nested blocks.
Parses any kind of nested block supported by a concrete markup language.
Parses any kind of nested block supported by a concrete markup language.
Parses a single paragraph nested inside another block.
Parses a single paragraph nested inside another block. Markdown allows nested lists without preceding blank lines, therefore will detect list items in the middle of a parapraph, whereas a top level paragraph won't do that. One of the questionable Markdown design decisions.
Parses reStructuredText blocks, except for blocks that allow nesting of blocks.
Parses reStructuredText blocks, except for blocks that allow nesting of blocks. Only used in rare cases when the maximum nest level allowed had been reached
Parses 0 or 1 space character, always succeeds.
Returns an optimized, Array-based lookup function for the specified characters.
Returns an optimized, Array-based lookup function for the specified characters.
Returns an optimized, Array-based lookup function for the specified ranges of characters.
Returns an optimized, Array-based lookup function for the specified ranges of characters.
Parses a single paragraph.
Parses a single paragraph. Everything between two blank lines that is not recognized as a special Markdown block type will be parsed as a regular paragraph.
Fully parses the input from the specified reader and returns the configuration and root element.
Fully parses the input from the specified reader and returns the configuration and root element.
Fully parses the input from the specified reader and returns the document tree.
Fully parses the input from the specified reader and returns the document tree. This function is expected to always succeed, errors would be considered a bug of this library, as the parsers treat all unknown or malformed markup as regular text.
Fully parses the input from the specified reader and returns the result.
Fully parses the input from the specified reader and returns the result. This function is expected to always succeed, errors would be considered a bug in this library, as the parsers treat all unknown or malformed markup as regular text.
Fully parses the specified input string and returns the result.
Fully parses the specified input string and returns the result. This function is expected to always succeed, errors would be considered a bug in this library, as the parsers treat all unknown or malformed markup as regular text.
Parses all nested blocks inside the specified indented block.
Parses all nested blocks inside the specified indented block.
Parses all nested blocks for the specified input and nest level.
Parses all nested blocks for the specified input and nest level.
Delegates to the abstract nestedBlock
parser that sub-traits need to define.
The nest level is primarily used as a protection against malicious
input that forces endless recursion.
the input to parse
the level of nesting with 0 being the outermost level
the parser result as a list of blocks
Parses all nested blocks for the specified input and nest level.
Parses all nested blocks for the specified input and nest level.
Delegates to the abstract nestedBlock
parser that sub-traits need to define.
The nest level is primarily used as a protection against malicious
input that forces endless recursion.
the input to parse
the level of nesting with 0 being the outermost level
the parser result as a list of blocks
Extension hook for assembling the block parsers for a particular markup format.
Extension hook for assembling the block parsers for a particular markup format.
true if these are parsers for nested blocks, false if they are for top level blocks
a list of block parsers which later will be interpreted as choices in the specified order
Parses a quoted block, a paragraph starting with a '>'
character,
with subsequent lines optionally starting with a '>'
, too.
A parser generator for repetitions where all subsequent parsers after the first depend on the result of the previous.
A parser generator for repetitions where all subsequent parsers after the first depend on the result of the previous.
the parser to use for the first piece of input
a function that determines the next parser based on the result of the previous
(Changed in version 2.9.0) The p0
call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
Uses the parser for at most the specified number of repetitions, always succeeds.
Uses the parser for at most the specified number of repetitions, always succeeds. The result is the list of results from applying the parser repeatedly.
Uses the parser for at least the specified number of repetitions or otherwise fails.
Uses the parser for at least the specified number of repetitions or otherwise fails. Continues to apply the parser after the minimum has been reached until if fails. The result is the list of results from applying the parser repeatedly.
Parses the rest of the line from the current input offset no matter whether it consist of whitespace only or some text.
Parses the rest of the line from the current input offset no matter whether it consist of whitespace only or some text. Does not include the eol character(s).
Parses a full document, delegating most of the work to the topLevelBlock
parser.
Parses a full document, delegating most of the work to the topLevelBlock
parser.
Parses a horizontal rule, a line only decorated with three or more '*'
, '-'
or '_'
characters with optional spaces between them
Parses a 1st or 2nd level Setext header.
Parses a 1st or 2nd level Setext header. A first level header consists of the
text of the header followed by a line of one or more '='
characters, a 2nd
level header uses '-'
characters instead.
In contrast to several other Markdown parsers this parser requires a blank line before the header.
Parses all of the standard Markdown blocks, except normal paragraphs and those blocks that deal with verbatim HTML.
Parses all of the standard Markdown blocks, except normal paragraphs and those blocks that deal with verbatim HTML. For the latter parsers are provided by a separate, optional trait.
Parses a single tab or space character.
Parses a single text line from the current input offset (which may not be at the start of the line.
Parses a single text line from the current input offset (which may not be at the start of the line. Fails for blank lines. Does not include the eol character(s).
Parses any kind of top-level block supported by a concrete markup language.
Parses any kind of top-level block supported by a concrete markup language.
Creates a new parser that produces a tuple containing the current nest level as well as the result from the specified parser.
Creates a new parser that produces a tuple containing the current nest level as well as the result from the specified parser.
The nest level is usually only used to prevent endless recursion of nested blocks.
Parses horizontal whitespace (space and tab).
Parses horizontal whitespace (space and tab). Always succeeds, consuming all whitespace found.
(Since version 2.10.0) lastNoSuccess was not thread-safe and will be removed in 2.11.0
(Since version 2.10.0) lastNoSuccess was not thread-safe and will be removed in 2.11.0
Provides all block parsers for Markdown text except for those dealing with verbatim HTML markup which this library treats as an optional feature that has to be explicitly mixed in.
Block parsers are only concerned with splitting the document into (potentially nested) blocks. They are used in the first phase of parsing, while delegating to inline parsers for the 2nd phase.