Keeps track of visited tags and provides a lookup for link ids.
Defines a lookup map for link definitions.
A set of tags we have already created.
A set of tags we have already created. Used to prevent nesting a link in a link or an emphasis in an emphasis.
Succeeds if the given parsers succeeds and the given function is defined at the parse result.
Succeeds if the given parsers succeeds and the given function is defined at the parse result. Returns the result of the method applied to the given parsers result.
Matches exactly one char, no matter which.
Matches exactly one char, no matter which. This differs from "elem" as it returns a string consisting of that char.
Runs the given parser on the given input.
Runs the given parser on the given input. Expects the parser to succeed and consume all input. Throws an IllegalArgumentException if parsing failed.
Runs the inline parser on the given input and returns the result
Parses two spaces at the end of a line to a manual break (
)
Parses two spaces at the end of a line to a manual break (
)
Parses an inline code element.
Parses an inline code element.
An inline code element is surrounded by single backticks ("")
or double backticks ("
").
Defines how the output is formatted and whether inline xml elements are allowed.
An image with an explicit path.
Hand rolled parser that parses a chunk of special inline markdown (like links or emphasis) based on a one char lookahead.
Parses emphasized text wrapped in asterisks: *foo*
Parses emphasized text wrapped in underscores: _foo_
Either returns the XML escape sequence for the given char or null.
Either returns the XML escape sequence for the given char or null. This does not return Option[String] on purpose. While Option[String] would be a much cleaner solution, this is actually called so often that it is a noticeable difference if we use Option here.
Escapes the given char for XML.
Escapes the given char for XML. Returns Either the necessary XML escape Sequence or the same char in a String.
Escapes the given string so it it can be embedded in xml.
Escapes the given string so it it can be embedded in xml. Markdown escapes are not processed.
A shortcut markdown link of the form <http://example.
A shortcut markdown link of the form <http://example.com>
A markdown link with the full url given.
Parses an id reference.
Parses an id reference. (Any text that is not a square bracket) Succeeds only if the parsed id is found in the given lookup. Returns the found link definition and the matched text.
Parses either a referenced or a directly defined image.
Parser for inline markdown, always consumes all input, returns the resulting HTML.
A link started by square brackets, either a reference or a a link with the full URL.
Inline markdown in a link.
Inline markdown in a link. Like normal inline stuff but stops when it reaches a closing square bracket.
Looks if the preceding char was one of the given chars.
Looks if the preceding char was one of the given chars. Never consumes any input.
Parses markdown text up to any of the chars defined in the given map.
Parses markdown text up to any of the chars defined in the given map. used to quickly escape any text between special inline markdown like emphasis.
Accepts a unix newline and returns a string containing a single newline.
Accepts a unix newline and returns a string containing a single newline.
Parses a single inline token.
Parses a single inline token. Either a span element or a chunk of text.
Matches one of the given char keys in the map.
Matches one of the given char keys in the map. Returns the string value for the matched char in the given map.
Matches one of the chars in the given set.
Matches one of the chars in the given set. Returns a string with the matched char.
accepts zero or more spaces or tabs returns the matched whitespace
accepts zero or more spaces or tabs returns the matched whitespace
Matches one char in the given range, returns the matched char.
Matches one char in the given range, returns the matched char.
A markdown reference of the form [text][id], [idText][] or [idText] Parser returns a tuple with the link definition first and the text to display second.
Parses a referenced image.
Plaintext variant to refInline.
Plaintext variant to refInline. Escapable text until a square bracket is hit.
A markdown link which references an url by id.
(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.
Matches everything in the parsed string up to the end.
Matches everything in the parsed string up to the end. Also matches the empty String. Returns the matched String.
Whitespace is sometimes important in markdown parsing, we handle it manually.
Whitespace is sometimes important in markdown parsing, we handle it manually. So this returns false.
Parses a span element like foo or *bar*
Either an emphasis or a strong text wrapped in asterisks.
Parses inline in a span element like bold or emphasis or link up until the given end marker
Either an emphasis or strong text wrapped in underscores.
Chars that may indicate the start of a special Markdown inline sequence.
Chars that may indicate the start of a special markdown inline sequence or the end of a link text.
Parses strong text in asterisks: **foo**
Parses strong text in underscores: foo
A title is everything in quotation marks.
A title is everything in quotation marks. We allow even quotation marks in quotation marks. We look ahead if we hit the closing brace after the quotation marks to detect if the title ends or not.
We parse everything as a link/img url until we hit whitespace or a closing brace.
Returns a verbose description of a char (printed char & hex code).
Returns a verbose description of a char (printed char & hex code). Used for debugging.
accepts one or more spaces or tabs returns the matched whitespace
accepts one or more spaces or tabs returns the matched whitespace
Parses an XML Attribute with simplified value handling like xmlAttrVal.
Parses an XML Attribute with simplified value handling like xmlAttrVal.
Parses a Simplified xml attribute: everything between quotes ("foo") everything between the quotes is run through the escape handling That way you can omit xml escaping when writing inline XML in markdown.
Parses a Simplified xml attribute: everything between quotes ("foo") everything between the quotes is run through the escape handling That way you can omit xml escaping when writing inline XML in markdown.
Parses closing xml tags.
Parses closing xml tags.
Parses an XML name (tag or attribute name)
Parses an XML name (tag or attribute name)
Parses an XML name char according to W3C spec except that range #x10000 to #xEFFFF is excluded
Parses an XML name char according to W3C spec except that range #x10000 to #xEFFFF is excluded
Parser for one char that starts an XML name.
Parser for one char that starts an XML name. According to W3C specs except that range #x10000 to #xEFFFF is excluded (cannot be expressed by char literals)
Parses an xml start or empty tag, attribute values are escaped.
Parses an xml start or empty tag, attribute values are escaped.
Parses any xml tag and escapes attribute values.
(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
A parser for inline markdown, markdown escapes and XML escapes. This is used by the result classes of the block parsers to handle Markdown within a block.